tilejson-spec icon indicating copy to clipboard operation
tilejson-spec copied to clipboard

distinguish satellite from terrain tiles

Open andrewharvey opened this issue 8 years ago • 4 comments

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

andrewharvey avatar Dec 04 '17 06:12 andrewharvey

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?

nigels-com avatar Feb 10 '18 09:02 nigels-com

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.

andrewharvey avatar Feb 13 '18 03:02 andrewharvey

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

GretaCB avatar Apr 11 '18 20:04 GretaCB

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.

andrewharvey avatar Apr 14 '18 09:04 andrewharvey