Conversation
|
I guess I should also say: It's obviously fine if you don't want this feature. We didn't discuss it up front or anything, so I won't feel burned. It was an itch I wanted to scratch for myself, but I would definitely rather upstream it, than live in permanent fork territory if it's useful to you. |
5a6db38 to
26df2c1
Compare
26df2c1 to
16c838f
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #106 +/- ##
==========================================
+ Coverage 77.84% 80.59% +2.74%
==========================================
Files 11 15 +4
Lines 1422 2128 +706
Branches 1422 2128 +706
==========================================
+ Hits 1107 1715 +608
- Misses 210 277 +67
- Partials 105 136 +31 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This was pulled out of #106, but you might find it nice on its own. Note this is a breaking change, since `TileId::new` is public and we've added a new PmtError enum.
|
@lseelenbinder - is adding the |
|
@michaelkirk |
|
any CLI automatically requires |
Agreed. :) I'm just saying the extract functionality is fine to have in the library, not that it's super useful without a CLI. |
|
My own use case for extract is within a mobile application - so not a CLI. But I freely admit it’s weird!
|
16c838f to
bcc7a70
Compare
Currently only HTTP has an interesting implementation. I suspect I'll need to clean up feature flags before upstreaming.
This involves more seeking, but we're never holding the lock while waiting for network activity. Measurements show 20% improvement for a west coast (1.2gb) download with 50ms latency @ 100MBPS I suspect a bigger improvement on slower networks, and a worse improvement on slower disks.
bcc7a70 to
31fd7d2
Compare
In a rust project I'm working on, I want to slice out a subset of a pmtiles archive (just like the go
pmtiles extractcommand).You can see it in action in this video, where I extract an area around the city of Seattle from a planet.pmtiles using the HTTP (range request) backend.
pmtile-extract-seattle.mov.mp4
In the log, the first 8 requests traverse the necessary metadata and directories to figure out where all the tiles live. The next 36 requests fetch the tile data.
It was a large endeavor, and to be honest, when I started, I wasn't sure it was going to work out, but it went relatively well! Unfortunately, this branch is kind of a mess. I'm going to carve out some bite-sized PR's from this branch, more suitable for human consumption, but I wanted to have this as a reference in case anyone wanted the bigger picture.