|
| 1 | +Metadata-Version: 2.1 |
| 2 | +Name: python-srtm |
| 3 | +Version: 0.2.0 |
| 4 | +Summary: |
| 5 | +Home-page: https://github.com/adamcharnock/python-srtm |
| 6 | +License: MIT |
| 7 | +Keywords: nasa,geospatial,altitude,elevation-profile |
| 8 | +Author: Adam Charnock |
| 9 | + |
| 10 | +Requires-Python: >=3.8,<4.0 |
| 11 | +Classifier: License :: OSI Approved :: MIT License |
| 12 | +Classifier: Programming Language :: Python :: 3 |
| 13 | +Classifier: Programming Language :: Python :: 3.8 |
| 14 | +Project-URL: Repository, https://github.com/adamcharnock/python-srtm |
| 15 | +Description-Content-Type: text/markdown |
| 16 | + |
| 17 | +# NASA SRTM altitude data parsing in Python |
| 18 | + |
| 19 | +Provides an API onto SRTM `.hgt` or `.hgt.zip` files. |
| 20 | + |
| 21 | +Requires Python 3.8, **may** work with Python 3.6 & 3.7. |
| 22 | + |
| 23 | +## Installation |
| 24 | + |
| 25 | +``` |
| 26 | +pip install python-srtm |
| 27 | + |
| 28 | +export SRTM1_DIR=/path/to/srtm1/ |
| 29 | +export SRTM3_DIR=/path/to/srtm3/ |
| 30 | +``` |
| 31 | + |
| 32 | +## Use |
| 33 | + |
| 34 | +You can access either SRTM1 or SRTM3 data. SRTM 1, for example: |
| 35 | + |
| 36 | +```python |
| 37 | +# SRTM1 - 30m resolution |
| 38 | +>>> from srtm import Srtm1HeightMapCollection |
| 39 | +>>> srtm1_data = Srtm1HeightMapCollection() |
| 40 | +>>> srtm1_data.get_altitude(latitude=40.123, longitude=-7.456) |
| 41 | +615 |
| 42 | +>>> Srtm1HeightMapCollection().get_elevation_profile(40.123, -7.456, 40.129, -7.460) |
| 43 | +[615, 620, 618, 620, 616, 603, 593, 582, 575, 579, 580, 589, 589, 581, 565, 553, 545, 541, 534, 533, 529, 520, 514] |
| 44 | +``` |
| 45 | + |
| 46 | +Or SRTM3: |
| 47 | + |
| 48 | +```python |
| 49 | +# SRTM3 - 90m resolution |
| 50 | +>>> from srtm import Srtm3HeightMapCollection |
| 51 | +>>> srtm3_data = Srtm3HeightMapCollection() |
| 52 | +>>> srtm3_data.get_altitude(latitude=40.123, longitude=-7.456) |
| 53 | +608 |
| 54 | +>>> Srtm3HeightMapCollection().get_elevation_profile(40.123, -7.456, 40.129, -7.460) |
| 55 | +[626, 616, 585, 593, 577, 548, 528, 514] |
| 56 | +``` |
| 57 | + |
| 58 | +## Profiling |
| 59 | + |
| 60 | +```python |
| 61 | +import cProfile |
| 62 | +cProfile.run('function_to_profile()', filename='output.cprof') |
| 63 | +``` |
| 64 | + |
| 65 | +```bash |
| 66 | +brew install qcachegrind |
| 67 | +pip install pyprof2calltree |
| 68 | +pyprof2calltree -k -i /pythonprofiling/profiler/first_iteration.cprof |
| 69 | +``` |
| 70 | + |
| 71 | +## Release process |
| 72 | + |
| 73 | +For internal reference: |
| 74 | + |
| 75 | +``` |
| 76 | +# Run the tests |
| 77 | +pytest |
| 78 | + |
| 79 | +# Update the setup.py |
| 80 | +dephell convert |
| 81 | +black setup.py |
| 82 | + |
| 83 | +# Ensure poetry.lock is up to date |
| 84 | +poetry lock |
| 85 | + |
| 86 | +export VERSION="VERSION HERE" |
| 87 | + |
| 88 | +# Version bump |
| 89 | +poetry version $VERSION |
| 90 | + |
| 91 | + |
| 92 | +# Commit |
| 93 | +git add . |
| 94 | +git commit -m "Releasing version $VERSION" |
| 95 | + |
| 96 | +# Tagging and branching |
| 97 | +git tag "v$VERSION" |
| 98 | +git branch "v$VERSION" |
| 99 | +git push origin \ |
| 100 | + refs/tags/"v$VERSION" \ |
| 101 | + refs/heads/"v$VERSION" \ |
| 102 | + master |
| 103 | + |
| 104 | +poetry publish --build |
| 105 | +``` |
| 106 | + |
0 commit comments