GeoJSON proxy to popular elevation web services.
Currently only Google Elevation API is implemented.
New backends or improvements very welcome!
Tribute to Nodeshot and Leaflet.Elevation
This code was originally written for Nodeshot in order to add an elevation profile feature using the wonderful Leaflet.Elevation javascript plugin.
Later the code was refactored and extracted into this python package.
Install via pip:
pip install geojson_elevation
Install tarball:
pip install https://github.com/ninuxorg/python-geojson-elevation/tarball/master
Alternatively you can install via pip using git:
pip install -e git+git://github.com/ninuxorg/python-geojson-elevation#egg=geojson-elevation
If you want to contribute, install your cloned fork:
git clone [email protected]:<your_fork>/python-geojson-elevation.git
cd python-geojson-elevation
python setup.py develop
from geojson_elevation.google import elevation
# 1 point
elevation('41.889040454306752,12.525333445447737')
# path
elevation('41.889040454306752,12.525333445447737|41.889050454306752,12.525335445447737')
Install your forked repo:
git clone git://github.com/<your_fork>/python-geojson-elevation
cd python-geojson-elevation/
python setup.py develop
Install test requirements:
pip install -r requirements-test.txt
Run tests with:
./runtests.py
Alternatively, you can use the nose
command (which has a ton of available options):
nosetests
nosetests tests.google_tests # run only google elevation API tests
See test coverage with:
coverage run --source=geojson_elevation runtests.py && coverage report
- Join the mailing list
- Fork this repo and install it
- Follow PEP8, Style Guide for Python Code
- Write code
- Write tests for your code
- Ensure all tests pass
- Ensure test coverage is not under 90%
- Document your changes
- Send pull request