heremaps / tin-terrain

A command-line tool for converting heightmaps in GeoTIFF format into tiled optimized meshes.
MIT License
579 stars 126 forks source link

How to generate tiles from NASA SRTM ? #71

Open icemagno opened 4 years ago

icemagno commented 4 years ago

Can you provide an example on how to generate Cesium terrain from .hgt ( or .vrt ) just like cesium-terrain-builder ?

yesitsme007 commented 4 years ago

I'm not sure if this is helpful for you: I did not try Cesium but generated .obj files instead. I guess the workflow is the same. Let's say you want to model the area between latitude 47.90 and 47.66, longitude 11.53 and 11.88:

gdal_translate -projwin 11.53 47.9 11.88 47.66 N47E011.hgt watzmann.tif
gdalwarp -t_srs -overwrite  EPSG:3857 watzmann.tif watzmann-epsg.tif
./tin-terrain dem2tin --input watzmann-epsg.tif --output watzmann.obj --max-error 2.0

And you will get a nice model of the famous Watzmann mountain :) This is such a cool tool. If you run into issues take a look at gdalinfo output. It gives a lot of useful information. Be careful to set the overwrite flag. It took me hours to debug until I found that gdalwarp will reuse wrong coordinates from an existing file from a previous run until you set this flag or delete the file before.

Meshlab-View
icemagno commented 4 years ago

This is not what I need. I need an alternative to Cesium terrain builder. The final result must be terrain files in a zoom level folder structure with one json file.