mapbox / mapbox-gl-js

Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
https://docs.mapbox.com/mapbox-gl-js/
Other
11.08k stars 2.21k forks source link

Support additional encoding formulas for RasterDEM sources #5824

Open mollymerp opened 6 years ago

mollymerp commented 6 years ago

Now that #5286 has shipped, we can start thinking about enhancing the functionality. Right now RasterDEM sources only support the mapbox terrain-rgb tileset, but we should extend it to allow support for other DEM encoding formulas.

ibesora commented 6 years ago

Hi, first of all, good job with #5286. We have gotten great results using our own DEM, although there are some things to fix in our side.

I think a good candidate would be Mapzen's terrarium. Now that it's shutting down their terrain tiles would find a new home at Mapbox. How I'm thinking about doing that is the following: on the rendering side only the decoding formula should be changed so, in order to mantain the expansion of the number of possible encodings, the formula could be appended to the shader from the js code. On the js side, a new raster source type (raster-dem-mapzen?) would need to be defined on the spec, and the decoding formula should be injected into the shader. Does that sound good?

Another terrain encoding that we use are Mapzen's normal maps. Supporting that would allow to bypass the slope prepass. To do so, the hillshade shader should be modified to support normals encoded in the rgb channels instead of only the rg ones. I'm more inclined on doing that via macro injection because, in contrast with the slope prepass, there's not an extensive list of decodings possible.

Should I give it a try?

andrewharvey commented 6 years ago

For me it's a higher priority to have the Mapbox platform support users uploading their own DEMs into terrain-rgb Tilesets in addition to the Mapbox Global DEM, but I realise that's out of scope for gl-js :wink:

beginor commented 6 years ago

What about ESRI's World Elevation Service, is it possible to support it?

ghost commented 4 years ago

Hello, is it now possible to upload geotif dem converted in RGB encoded mbtile using rio-rgbify as rasterdem and use it in mapbox studio and unity instead of terrain-rgb Tileset ?

andrewharvey commented 4 years ago

is it now possible to upload geotif dem converted in RGB encoded mbtile using rio-rgbify as rasterdem and use it in mapbox studio and unity instead of terrain-rgb Tileset ?

If you use rio-rgbify with the right parameters and then upload as a Tileset, you shouldn't need a custom encoding format for the raster-dem source here, you should be able to use the built in one.

ghost commented 4 years ago

In fact I would like to convert my personnal raster dem built with LiDAR datas to the same format that uses Terrain RGB-Tileset and import it into mapbox Studio and use my personnal more accurate elevation datas instead of Terrain RGB-Tilset

dadebue commented 1 year ago

Pretty old issue but it would be really cool if we could use other encodings.

I'm interested in ESRI's World Elevation Service and here too @beginor. Is there some way we can use the ESRI terrain source?