t-rex-tileserver / t-rex

t-rex is a vector tile server specialized on publishing MVT tiles from your own data
https://t-rex.tileserver.ch/
MIT License
556 stars 69 forks source link

Generating tilesets with non-rectangular bounds #57

Open Tom-Cuthill opened 7 years ago

Tom-Cuthill commented 7 years ago

Currently in order to generate tiles we need to define the extent of tiles in rectangular terms.

We are very happy with t_rex and we are using it to generate tiles for a number of projects we have running. It is often the case that the tiles we need to generate cover very non-rectangular regions of Australia. I'm sure that other users will want to generate tiles over non-rectangular boundaries, particularly at higher zoom levels.

As a consequence, the tile generator runs for long periods, much of the time generating empty tiles which lie outside of the area of interest but within the single rectangular box bounding the tiles. It is very easy to specify the desired bound as a geometry in a table inside PostGIS. A wonderful enhancement to the generator would be to have some way of referencing the tile boundaries based on that geometry.

Thanks for all your efforts with t_rex and for all the benefits we and others have gained as a result!

Cheers, Tom Cuthill

pka commented 7 years ago

This feature is defintiely planned, but unfortunately not with a very priority right now. Thanks a lot for your positive feedback!

richardbischof commented 5 years ago

We're also interested in generating cache for non-rectangular bounds, and I want to share my thoughts on it. Maybe it would be sufficient to provide an extra table via the supported datastores (Postgres, Geopackage, ... ) that contains information on x,y,z of the tiles to generate. This table could be used from t_rex for iterating while generate. This approach should also be compatible with the generation using multiple processes, because the iteration could use a simple incrementor.

Idea: The table could be generated with mercantile. Given a geojson and zoom level, it can create lists of tiles that are crossed.

Example: cat niedersachsen.geojson | jq -c . | mercantile tiles 6

Leads to: [z,x,y] [33, 20, 6] [33, 21, 6] [34, 20, 6] [34, 21, 6]

What do you think?

All the best, Richard

pka commented 5 years ago

When using a tile list, I would expect a complete list for all zoom level like in #58.

Since t-rex has GDAL support in the meantime, smth. like the ogr-options of MapCache or a coverage definition like MapProxy wouldn't be hard to implement.