mapbox / tilejson-spec

JSON format for describing map tilesets.
255 stars 52 forks source link

distinguish satellite from terrain tiles #28

Open andrewharvey opened 6 years ago

andrewharvey commented 6 years ago

What do people think about adding an interpretation field for raster sources?

Currently Mapbox use TileJSON for

  1. a 3 band RGB raster to be displayed as is https://api.mapbox.com/v4/mapbox.satellite.json

  2. a 1 band raster encoded as a 3 band RGB. https://api.mapbox.com/v4/mapbox.terrain-rgb.json (https://blog.mapbox.com/blog/terrain-rgb/)

In the terrain-rgb case the formula for getting back to the 1 band raster is "-10000 + ((R 256 256 + G 256 + B) 0.1)".

Should the TileJSON spec distinguise these two types and contain the formula to get the real values like in (2)?

/cc @MateoV

nigels-com commented 6 years ago

We'd need a field for that to adopt TileJSON for our layers. We have RGB encoded terrain elevation, RGB endoded surface normals as well as various flavours of annotated RGB. Are other vendors already making these sort of annotations?

andrewharvey commented 6 years ago

Over in https://github.com/mapbox/mapbox-gl-js/pull/6110 it uses an encoding field which is an enum of mapbox | terrarium rather than exposing the actual formula used, but I think we should still use an interpretation field to separate terrain tiles from satellite.

GretaCB commented 6 years ago

Thanks for opening this ticket @andrewharvey @nigels-com . This proposed addition will be considered as part of the v4 push #35

andrewharvey commented 6 years ago

Thanks for opening this ticket @andrewharvey @nigels-com . This proposed addition will be considered as part of the v4 push #35

That's awesome to hear @GretaCB, looking forward to participating in the discussion to see if this makes sense for v4.