mapbox / rio-rgbify

Encoded arbitrary bit depth rasters in pseudo base-256
MIT License
99 stars 36 forks source link

Upload generated terrain-rgb to mapbox #19

Closed gotestrand closed 6 years ago

gotestrand commented 6 years ago

Hi,

I'm trying to achieve the same results as in the blogpost https://blog.mapbox.com/realistic-terrain-with-custom-styling-ce1fe98518ab

I've managed to create both geotif and .mbtiles from my terrain geotif, using rio-rgbify. After uploading the files to mapbox as a raster-layer the rgb-values get messed up by the compression of the tiles, causing the elevation-styling to be corrupt.

I don't know if this is the right forum, but any ideas would be helpful!

vincentsarago commented 6 years ago

Hi @gotestrand thank, for opening the issue.

After uploading the files to mapbox as a raster-layer the rgb-values get messed up by the compression of the tiles, causing the elevation-styling to be corrupt.

I'm may be wrong but last time I checked we cannot use geotiff/mbtiles terrain rgb in studio because when you upload it, it is recognized as raster and not as raster-dem. ref: https://github.com/mapbox/rio-rgbify/issues/17#issue-309403586

so it might result in something like 👇 capture d ecran 2018-06-29 a 10 00 44

I'm not aware this will change soon, you may contact mapbox support and ask about it.

dnomadb commented 6 years ago

Hi @gotestrand ! A few notes on this:

I should create a section in the README for this -- this tool was created before live hillshading in Mapbox GL JS existed, so wasn't a specifically planned use when this was written.

andrewharvey commented 6 years ago

I still have my :crossed_fingers: that eventually you'll be able to upload your single band GeoTIFF DEM to Mapbox and it will automatically handle converting it to terrain-rgb as a raster-dem.

nmanaud commented 6 years ago

Hi - I've been trying to do the same thing (Is it possible to import a rio-rgbify generated mbtiles file into Mapbox Studio?) got the following answer from the Mapbox support folks:

"While we do have terrain-rgb data available in our basemaps, it's not possible to create your own and use it within Mapbox Studio, and while it may be possible in Mapbox GL JS, there would be a lot of hurdles."

gotestrand commented 6 years ago

@dnomadb Thank you! After a bit of struggle I've succesfully managed to get my raster-dem working in mapbox-gl 😄

The final piece that was missing was to translate my geotiff to EPSG:3857 projection, before generating the final mbtiles file. The projection translation would be a nice feature to add to this repo!

My final steps in summary:

image

predictwise commented 4 years ago

I used mbtiles-server to release my own tiles service and it worked, but its format is png. So I used png tiles instead of pngraw tiles. I think they are the same?