未提供项目描述
项目描述
NASA SRTM高程数据在Python中的解析
提供对SRTM .hgt
或.hgt.zip
文件的API访问。
需要Python 3.8,可能支持Python 3.6和3.7。
安装
pip install python-srtm
export SRTM1_DIR=/path/to/srtm1/
export SRTM3_DIR=/path/to/srtm3/
使用
您可以访问SRTM1或SRTM3数据。例如SRTM1
# SRTM1 - 30m resolution
>>> 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]
或SRTM3
# SRTM3 - 90m resolution
>>> 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]
配置文件
import cProfile
cProfile.run('function_to_profile()', filename='output.cprof')
brew install qcachegrind
pip install pyprof2calltree
pyprof2calltree -k -i /pythonprofiling/profiler/first_iteration.cprof
发布流程
内部参考
# Run the tests
pytest
export VERSION="VERSION HERE"
# Version bump
poetry version $VERSION
# Update the setup.py
dephell convert
black setup.py
# Ensure poetry.lock is up to date
poetry lock
# 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
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。
源分布
python-srtm-0.5.0.tar.gz (8.6 kB 查看散列)
构建分布
python_srtm-0.5.0-py3-none-any.whl (8.9 kB 查看散列)