protomaps / go-pmtiles

Single-file executable tool for working with PMTiles archives
BSD 3-Clause "New" or "Revised" License
350 stars 48 forks source link

Add ability to get a subset of layers using pmtiles extract #164

Open eyeseast opened 4 months ago

eyeseast commented 4 months ago

If I'm using pmtiles extract to get a piece of a larger tileset, sometimes I might not want every layer available. Could extract also filter layers or give me a way to include or exclude layers?

The API could look something like this:

# only extract buildings and county boundaries
pmtiles extract input.pmtiles output.pmtiles --bbox "..." --layers "buildings,boundaries_country"

# get everything except water
pmtiles extract input.pmtiles output.pmtiles --bbox "..." --exclude-layers "water"
daniel-j-h commented 3 months ago

I ran into similar use cases where I started out with the .pmtiles matching the default basemaps style https://github.com/protomaps/basemaps but then wanted to slightly deviate from it. For example when you want a very simple overview map as shown below where we only need to style the water, earth, boundaries layers. At the moment I simply use the .pmtiles with much more data in them as needed by the simple style.

Two more considerations here

extract-layers