No project description provided
Project description
NASA SRTM altitude data parsing in Python
Provides an API onto SRTM .hgt
or .hgt.zip
files.
Requires Python 3.8, may work with Python 3.6 & 3.7.
Installation
pip install python-srtm
export SRTM1_DIR=/path/to/srtm1/
export SRTM3_DIR=/path/to/srtm3/
Use
You can access either SRTM1 or SRTM3 data. SRTM 1, for example:
# SRTM1
python
>>> from srtm import Srtm1HeightMapCollection
>>> srtm1_data = Srtm1HeightMapCollection()
>>> srtm1_data.get_altitude(latitude=40.123, longitude=-7.456)
615
>>> Srtm1HeightMapCollection().get_elevation_profile(40.123, -7.456, 40.129, -7.460)
[615, 620, 618, 620, 616, 603, 593, 582, 575, 579, 580, 589, 589, 581, 565, 553, 545, 541, 534, 533, 529, 520, 514]
Or SRTM3:
# SRTM3
python
>>> from srtm import Srtm3HeightMapCollection
>>> srtm3_data = Srtm3HeightMapCollection()
>>> srtm3_data.get_altitude(latitude=40.123, longitude=-7.456)
608
>>> Srtm3HeightMapCollection().get_elevation_profile(40.123, -7.456, 40.129, -7.460)
[626, 616, 585, 593, 577, 548, 528, 514]
Release process
# Run the tests
pytest
# Update the setup.py
dephell convert
black setup.py
# Ensure poetry.lock is up to date
poetry lock
export VERSION="VERSION HERE"
# Version bump
poetry version $VERSION
# Commit
git add .
git commit -m "Releasing version $VERSION"
# Tagging and branching
git tag "v$VERSION"
git branch "v$VERSION"
git push origin \
refs/tags/"v$VERSION" \
refs/heads/"v$VERSION" \
master
poetry publish --build
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python-srtm-0.1.0.tar.gz
(5.9 kB
view hashes)
Built Distribution
Close
Hashes for python_srtm-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c1216ecd646b5bc18f07429b0f83140e8ff5cb8a9bb5cc2d4cdff9e3cdb370d |
|
MD5 | 97efff412b3f6bf7bc64a73faeb7a7c8 |
|
BLAKE2b-256 | 90ccffd8820a3e3269f12f327c7bcafbb5c07362e77ddca92302a3d875e1afdd |