Giter VIP home page Giter VIP logo

Comments (6)

gotestrand avatar gotestrand commented on June 5, 2024 4

@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:

  • Translate geotiff to web mercator projection EPSG:3857. Using gdal with gdalwarp -t_srs EPSG:3857 -r lanczos -wo SOURCE_EXTRA=1000 -co COMPRESS=LZW [input-file] [output-file]
  • Create mbtiles using rio rgbify -b -10000 -i 0.1 --max-z 12 --min-z 0 --format png [input-file] [output-mbtiles]
  • Create a raster-dem source in mapbox, using pngraw tiles. Add layer to map, tada!

image

from rio-rgbify.

dnomadb avatar dnomadb commented on June 5, 2024 3

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.

from rio-rgbify.

vincentsarago avatar vincentsarago commented on June 5, 2024

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: #17 (comment)

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.

from rio-rgbify.

andrewharvey avatar andrewharvey commented on June 5, 2024

I still have my 🀞 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.

from rio-rgbify.

nmanaud avatar nmanaud commented on June 5, 2024

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."

from rio-rgbify.

predictwise avatar predictwise commented on June 5, 2024

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?

from rio-rgbify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.