Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global elevation tiles in PMTiles and on IPFS #361

Closed
hfu opened this issue Dec 27, 2023 · 11 comments
Closed

Global elevation tiles in PMTiles and on IPFS #361

hfu opened this issue Dec 27, 2023 · 11 comments
Assignees

Comments

@hfu
Copy link
Contributor

hfu commented Dec 27, 2023

In preparing #359, it would be great to have an open global elevation tiles (in PMTiles package).

Do you have any idea in implementing this? Digital Twin should be on a good topography.

@ubukawa Do we already have one?

@hfu
Copy link
Contributor Author

hfu commented Dec 27, 2023

I found this great entry by @ubukawa:
https://qiita.com/T-ubu/items/a90c3d42f809725f50ab

@hfu
Copy link
Contributor Author

hfu commented Dec 28, 2023

@hfu
Copy link
Contributor Author

hfu commented Mar 12, 2024

I prioritized this because I am working on Smart Local (#426).

@hfu
Copy link
Contributor Author

hfu commented Mar 21, 2024

@ubukawa kindly introduced the following two entries on how o create global elevation tiles from NASADEM:

@hfu
Copy link
Contributor Author

hfu commented Mar 22, 2024

@hfu hfu changed the title [IDEA] Global elevation tiles in PMTiles Global elevation tiles in PMTiles and on IPFS Mar 22, 2024
@hfu
Copy link
Contributor Author

hfu commented Mar 24, 2024

Site repo

I created a GitHub repository for a test site.

https://github.com/optgeo/gel

@hfu
Copy link
Contributor Author

hfu commented Mar 24, 2024

Test site screenshot

image

@hfu
Copy link
Contributor Author

hfu commented Mar 25, 2024

ズームレベル高いものの合成ができるようになってきました。

image

合成のためのスクリプトは、次のようにしています。

require 'sqlite3'

system "rm merged.*"
system "cp 0-0-0.mbtiles merged.mbtiles"
$target = SQLite3::Database.new('merged.mbtiles')

def add(path)
  (z0, x0, y0) = File.basename(path, ".mbtiles").split('-').map{|v| v.to_i}
  source = SQLite3::Database.new(path)
  source.execute('SELECT * FROM tiles') {|r|
    (z, x, y) = r[0..2]
    y = 2 ** z - y - 1
    print "#{z} #{x} #{y} - > 6 #{x >> (z - 6)} #{y >> (z - 6)} - #{z0} #{x0} #{y0}\n"
    $target.execute(
      "INSERT INTO tiles (zoom_level, tile_column, tile_row, tile_data) VALUES (?, ?, ?, ?)", 
      r
    ) if (x >> (z - 6)) == x0 and (y >> (z - 6)) == y0
  }
end

Dir.glob("6-*.mbtiles") {|path| add(path)}
system "pmtiles convert merged.mbtiles merged.pmtiles"

@hfu
Copy link
Contributor Author

hfu commented Mar 27, 2024

西から回ってきて、アフリカの西岸まで辿り着いてきました。

image

@hfu
Copy link
Contributor Author

hfu commented Mar 30, 2024

Source Cooperative からの publishment について相談を開始してみました。

英語話者の方々にとって、@ubukawa のこのエントリが非常に役立つのだと思うに至りました。
https://qiita.com/T-ubu/items/c7bb5697b51f245ef163

@hfu
Copy link
Contributor Author

hfu commented May 2, 2024

This was successfully completed by #464!

@hfu hfu closed this as completed May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant