mapbox/tilejson-spec

distinguish satellite from terrain tiles

andrewharvey opened this issue · 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

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?

Over in mapbox/mapbox-gl-js#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.

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

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.