-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
pmtiles extract feedback thread #68
Comments
I failed to download from a cloudflare R2 bucket:
Maybe I did not construct the urls properly? I can write to this bucket with rclone. |
I was able to extract all tiles of Switzerland from a planet-scale pmtiles file with the new command in like a second or even less!
with |
this looks correct, did you set |
adding multithreading in #68 TODOs:
|
* change tasks of byte ranges from slice to linked list * default download threads to 4; fix tests [#68] * return errors from download threads
* fix normalization of local paths via filepath.Abs * force the parameter awssdk=v2 for s3 buckets to use newer SDK
@wipfli v1.9.1 out with public URL support and multithreading: https://github.com/protomaps/go-pmtiles/releases/tag/v1.9.1 |
Many thanks for a fantastic update! Another success case here. I extracted one city (Tsukuba-shi / つくば市) from GSI topographic map PMTiles hosted on IPFS. Took 25 sec with go-pmtiles v1.9.1. ![]() I'm curious to know if it's possible to extract geometries exactly within the extent geometry. I am afraid it would not be the function of go-pmtiles because it can handle different content type, but cutting vector tileset by extent geometry in exact way looks nice - as in https://optgeo.github.io/14321/#12.84/35.37698/139.38385 |
@hfu the tiles that are included in the extract are "exactly" the ones covering the extent - for example, if you provide a circular extent, the highest zoom tiles that do not touch the circle, at the corners of the bounding box, will not be included. However, the extract process currently does not modify the tile contents. Ideally, the extract process should detect you are working with MVT and then clip every geometry exactly to the extent, so that the lowest zoom does not include information outside of the extent. This is possible and I would like to implement it; the major outstanding issue is the lack of a pure-Go library for robust geometry operations. The conservative choice would be to use GEOS (C++) via its C API, but that will make packaging and distributing In the meanwhile, one remedy is to provide a "mask" polygon that is the inverse of your extent and display this as a layer in MapLibre with a solid color between the shape and label layers. This mostly accomplishes correct display, with some drawbacks, such as labels still appearing outside the extent. |
@bdon Many thanks for sharing your thought! Yes, I was also thinking about masking as one remedy and I was also thinking that labels would be cut by the mask. But as long as we are on vector tiles, yes we can put labels over the mask and make labels appear outside the extent mask. I am excited to know about your intention to implement clipping inside go-pmtiles and I thank you sharing the implementation consideration. As long as I suppose my use case is somewhat less popular, I would also think about slower way by scripting. Maybe I will be thinking about the following steps if I have some time.
This might be slow, ugly, and tend to lose some precision, but it would work as a proof of concept. I would like to update you about my scripting project, probably by mentioning you from my repository. Again, I appreciate and respect your work expanding the horizon of free and open source software! |
@bdon wrote:
When you implement "clipping inside tiles", please make that optional. I am thinking about making multiple per-region extracts available for offline viewing, and allowing multiple such extract to be used on a "first available tile" basis. In this scenario, keeping the original tiles intact seems essential for creating a seamless map that covers neighboring regions. |
@zstadler yes, it would be optional. |
Response to
|
@zstadler is your issue the ctrl-C hanging, or the slow download speed? Can you tell us your operating system? |
It's the response to |
I wasn't able to reproduce any problem with |
Comment in this thread with your reports on version 1.9's
extract
command.HOW TO USE
Info
pmtiles extract
example run, extracting z0-z15 US + Mexico from a planet OSM basemap hosted on Source Cooperative, medium EC2 instance in same AWS region
That's 28,000 tiles a second
Right now the download is unoptimized and single threaded - the priority right now is to ensure that the result is correct, we'll make a multithreaded extractor after.
Things to try
--overfetch=0.1
By default, the downloader will batch nearby requests by downloading slightly more data, by default 10%.--overfetch=1.0
lets it download twice the final size of data.--dry-run
prints out stats without actually downloading tile dataThe text was updated successfully, but these errors were encountered: