Creates synthetic digital elevation models (DEMs) from point data.
Prerequisites:
Usage:
-
Add points to
dem_orig.csv
. Contour interpolation will be done between consecutive points of the same elevation, in order. -
Open a terminal in the folder with
interp.py
and runpython3 interp.py dem_orig.csv <interpolation interval>
where<interpolation interval>
is the distance between points in Easting/Northing units, e.g. 10. Too fine values may cause sharp contours, while too sparse values may result in rough contours. -
Run
gdal_grid
with the appropriate settings. Example outputs are produced withgdal_grid -a invdist:power=3.0:smoothing=5.0:maxpoints=6 -outsize 1200 1200 -of GTiff -l dem dem.vrt dem.tiff
. See gdal_grid documentation for details on interpolation algorithms. -
The resulting
dem.tiff
should be readable by QGIS/ArcGIS. Some programs may take a .png instead; this can be done using gdal_translate with something like (gdal_translate -of PNG -scale -outsize 120 120 dem.tiff dem.png
)
Further steps:
-
To 3D print, run a .png through heightmap2stl (using grayfix.py may also be needed to fix grayscale log values, e.g.
python grayfix.py dem.png dem_fix.png
) -
Import a voxel version to MagicaVoxel with FileToVox
-
Import to Sketchup with the BitmapToMesh plugin (may not work, try other plugins or maybe convert to STL and use Sketchup-STL)