tegola
tegola copied to clipboard
Use slippy.Grid to support tiles in different projections systems
This issue is for a design of using the new slippy.Grid
in tegola, in order for it to output multiple projection systems. Implementation of this functionality would close #243, #267, and #660.
Some issues to consider for this design are:
- where should the output projection system be specified? (url query string, config, command line?)
- where in the code should the conversion take place? and how should the info from (1) get there?
- Depending on (1) how should the cache work?
- the same
/:map/:layer/:z/:x/:y
could have multiple tiles with different projections
- the same
(I'll post my own later this week)
I know @jj0hns0n has some opinions on this with some of the work he's been prototyping.
@ear7h lets have a quick chat in slack. Definitely have some opinions about 1 & 3 based on work for the OGC testbed.
After talking to @jj0hns0n it looks like we should add support for OGC API tiles. It looks like:
{
"description": "OGC API Tiles",
"links": [
{
"href": "http://tiles.example.com/maps/{tileMatrixSetId}/{tileMatrix}/{tileCol}/{tileRow}.pbf",
"rel": "item",
"title": "Mapbox vector tiles",
"type": "application/vnd.mapbox-vector-tile"
}
],
"tileMatrixSetLinks": [
{
"tileMatrixSet": "WorldCRS84Quad",
"tileMatrixSetURI": "http://schemas.opengis.net/tms/1.0/json/examples/WorldCRS84Quad.json"
},
{
"tileMatrixSet": "WebMercatorQuad",
"tileMatrixSetURI": "http://schemas.opengis.net/tms/1.0/json/examples/WebMercatorQuad.json"
}
],
"title": "OGC-API-Tiles"
}
This format is helpful in understanding how one client might deal with multiple projection systems. One rule we that should guide the implementation is each served tile set must have the same srid for all of its layers but, a map configured in tegola can result in multiple served tile sets. An implementation might entail:
- In the config, a map would have a
projections
array parameter to take all the SRIDs- there would also be configurations like
srid_format
andsrid_query
to tell tegola how the the composite map name (name + srid) will be constructed or the name of the url query var respectively (the two options are mutually exclusive).
- there would also be configurations like
- an array of SRIDs would be part of each
atlas.Map
- a single
atlas.Map
might actually return multiple maps for serving as a tilejson/ogc api - the srid becomes part of the key in the
cache
- a single
- Projection conversion would happen in
atlas.Map.EncodeMVTile
where there is currently a check for it