Closed arkonsolutions closed 7 months ago
Well, convert them into a geotiff or srtm syntax and create a entry in the config.yaml. I just had a quick look, but it seems like, that gdal can handle .pgm files so that shouldnt be a problem.
Yes, I have succeeded in this case.
My steps (Windows 10 + wsl):
Downloading and unzipping a PGM file.
wsl
cd /mnt/c/
mkdir Volumes/egm2008-5
cd Volumes/egm2008-5
wget https://sourceforge.net/projects/geographiclib/files/geoids-distrib/egm2008-5.tar.bz2
tar -xjvf egm2008-5.tar.bz2
Convering PGM to GeoTiff
mkdir geotiff
cd /mnt/c/Volumes/egm2008-5/geoids
gdal_translate -ot Float32 -scale 0 65000 -108 87 egm2008-5.pgm ../geotiff/egm2008-5.tiff
Opentopodata config.yaml
max_locations_per_request: 100
datasets:
name: egm2008-5 path: /app/data/egm2008-5/geotiff
* Assemby and run opentopodata
cmd (not wsl):
cd opentopodata docker build --tag opentopodata --file docker/Dockerfile .
docker run --rm -it --volume "C:/Volumes/:/app/data:ro" -p 5000:5000 -e N_UWSGI_THREADS=8 opentopodata sh -c "/usr/bin/supervisord -c /app/docker/supervisord.conf"
Results:
take a location:
10.168455, 49.402717
Online GeoidEval calculator
https://geographiclib.sourceforge.io/cgi-bin/GeoidEval?input=10.168455+49.402717&option=Submit
returns: -29.4900
GET http://localhost:5000/v1/egm2008-5?locations=10.168455, 49.402717
{ "results": [ { "dataset": "egm2008-5", "elevation": -29.48802375793457, "location": { "lat": 10.168455, "lng": 49.402717 } } ], "status": "OK" }```
Oh cool, thanks for reporting back with instructions!!!
Hello!
Please tell me how to approach this task and where to start.
Right here (https://geographiclib.sourceforge.io/C++/doc/geoid.html ) there are links to world-wide geoid files, they can be downloaded and converted to tif.