Render terrain scenery using elevation data from Kartverket.
- blåne (norwegian) - something that is so far away that it appears blue against mountains even further away, or towards the horizon.
- blikk (norwegian) - view
This software renders PNG images of scenery as seen from a given viewpoint in the terrain. A web server keeps elevation data in (virtual) memory for efficient access, and renders images when requested. There is also a crude web interface that allows selecting viewpoint and direction of sight by clicking a map.
- Install GDAL ≥ v3.0 and make headers available in sub-folder gdal. On linux:
ln -s /usr/include/gdal gdal
. - Sign up at Kartverket and download USGS DEM files from data set "DTM 10 Terrengmodell (UTM32)" into sub-folder dem-files.
- Install Go
At https://kartkatalog.geonorge.no/ locate dataset "DTM 10 Terrengmodell (UTM 32)".
To get started, download these two files:
- 6804_2_10m_z32.dem
- 6804_3_10m_z32.dem
Then start the web server
go run . --address=localhost:4242 --demfiles=dem-files --mmapfiles=/tmp
Then visit this URL to get a view from Galdhøpiggen towards Hurrungane
http://localhost:4242/bb?lat0=61.63637302336104&lng0=8.312476873397829&lat1=61.461421091200464&lng1=7.8714895248413095
©Kartverket
The geometry is based on cartesian coordinates in metric units (meters) as defined by the Universal Transverse Mercator coordinate system. Terrain far away are lowered to achieve a earth curvature effect. This is a simplistic geometrical model that will cause some distortion depending on location.