pnorman / tilekiln-old

A PostGIS-based vector tile generator
GNU General Public License v3.0
33 stars 6 forks source link

Accept bounds to limit area generation #8

Open pnorman opened 4 years ago

pnorman commented 4 years ago

https://github.com/mapbox/mercantile or https://github.com/mapbox/supermercado might be useful here

pnorman commented 4 years ago

Temporary workaround

echo "[-124, 47, -121, 50]" | mercantile tiles 12 | jq -r '"\(.[2])/\(.[0])/\(.[1])"' |\
tilekiln-generate tiles
ttomasz commented 3 years ago

Here's an example of using mercantile to get a list of tiles for bounding box of Poland and zoom levels from 6 to 12:

import mercantile as m

with open('./cache_low_zoom_tiles.sh', 'w', encoding='UTF-8') as f:
    for tile in m.tiles(14.0, 49.0, 24.03, 54.86, [6, 7, 8, 9, 10, 11, 12]):
        f.write(f'curl -s localhost/tiles/{tile.z}/{tile.x}/{tile.y}.pbf > /dev/null \n')

I could try to add it but what would you like the interface to look like? --bbox option taking string formed as 4 floats separated by commas?

pnorman commented 3 years ago

I could try to add it but what would you like the interface to look like? --bbox option taking string formed as 4 floats separated by commas?

Yes