elevation-profile
Table of Contents
1 Introduction
Simple elevation profile Web service similar to google's elevation Web service.
Demo installation using freeDEM data:
get elevation for some points (latitude, longitude) separated by "|" and return simple JSON
http://karme.de/elevation-profile/demo?locations=48.5,9|48.5,9.1&format=sjs
upsample path with a maximum distance of 100m and return a SVG plot of the profile:
http://karme.de/elevation-profile/demo?path=48.5,9|48.5,9.1&upsample=100&format=svg
fetch 20 samples along the path and return a SVG plot of the profile:
http://karme.de/elevation-profile/demo?path=48.5,9|48.5,9.1&samples=20&format=svg
2 output formats (format=)
js
JSON output http://karme.de/elevation-profile/demo?locations=48.5,9|48.5,9.1&format=js
sjs
JSON output (simple format) http://karme.de/elevation-profile/demo?locations=48.5,9|48.5,9.1&format=sjs
xml
XML output http://karme.de/elevation-profile/demo?locations=48.5,9|48.5,9.1&format=xml
sxml
SXML output http://karme.de/elevation-profile/demo?locations=48.5,9|48.5,9.1&format=sxml
sexpr
S-expression output http://karme.de/elevation-profile/demo?locations=48.5,9|48.5,9.1&format=sexpr
svg
SVG output http://karme.de/elevation-profile/demo?locations=48.5,9|48.5,9.1&format=svg
geojson
GeoJSON output http://karme.de/elevation-profile/demo?locations=48.5,9|48.5,9.1&format=geojson
3 (additional) features:
- free software / open source
- stacking of multiple DEMs (it is really simple to add another DEM dataset if the format is supported by gdal)
- upsample polyline (keeping original input points and inserting equidistant additional points if needed)
- wgs84 spheroid distance calculations
4 Development:
git repository at: https://karme.de/git/elevation-profile
file releases at: https://karme.de/elevation-profile/files/
5 Misc notes
If http overhead is a problem you might wish to use the elevation-profile tool providing a simple command line interface. You can use it either directly via pipes or in combination with systemd socket activation or good old inetd, xinetd or socat. For systemd and xinetd example configurations are included and installed by default. The default configuration binds to 127.0.0.1 only. If you want to limit access to a specific user on localhost you can try using ident and hosts.allow/deny (unfortunately the lua socket library doesn't support unix domain sockets, otherwise I would change the default config to unix domain sockets). The lua client example in lua/ uses socat.
Using apache2 I observed problems using mpm_event
and I suggest to use
mpm_prefork
for now:
a2dismod mpm_event ; a2enmod mpm_prefork