High-performance SRTM elevation data library
Project description
htg - High-performance SRTM Elevation Library
Python bindings for the htg Rust library, providing fast elevation queries from SRTM .hgt files.
Installation
pip install srtm
Quick Start
import srtm
# Create service with up to 100 cached tiles
service = srtm.SrtmService("/path/to/srtm", cache_size=100)
# Query elevation (Mount Fuji)
elevation = service.get_elevation(35.3606, 138.7274)
print(f"Elevation: {elevation}m") # 3776
# Interpolated query for smoother results
elevation = service.get_elevation_interpolated(35.3606, 138.7274)
print(f"Elevation: {elevation:.2f}m") # 3776.42
# Check cache performance
stats = service.cache_stats()
print(f"Cache hit rate: {stats.hit_rate:.1%}")
Utility Functions
import srtm
# Convert coordinates to filename
filename = srtm.lat_lon_to_filename(35.5, 138.7)
print(filename) # "N35E138.hgt"
# Parse filename to coordinates
coords = srtm.filename_to_lat_lon("N35E138.hgt")
print(coords) # (35, 138)
# Void value constant
print(srtm.VOID_VALUE) # -32768
SRTM Data
Download SRTM .hgt files from:
Performance
This library uses Rust for the core implementation, providing:
- <10ms response time for cached tiles
- Memory-mapped I/O for fast file access
- LRU caching to bound memory usage
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file srtm-0.2.0-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: srtm-0.2.0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 260.5 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ba65d3d926de1e7e04cbe16a8b948191d81b0ba3e67586ea7c2dfa3b81947bf
|
|
| MD5 |
ea54edbeafa80c5e4890f09149c21ef3
|
|
| BLAKE2b-256 |
be3c763b04a23b27ff619292ad7fa0196cb9ba3d8b1eb1618b57fd3eabdafa73
|
Provenance
The following attestation bundles were made for srtm-0.2.0-cp312-cp312-win_amd64.whl:
Publisher:
release.yml on pedrosanzmtz/htg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
srtm-0.2.0-cp312-cp312-win_amd64.whl -
Subject digest:
9ba65d3d926de1e7e04cbe16a8b948191d81b0ba3e67586ea7c2dfa3b81947bf - Sigstore transparency entry: 774339195
- Sigstore integration time:
-
Permalink:
pedrosanzmtz/htg@c2ec7ff3152f1edb4fcf56cfa03ebbedbb9cb851 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pedrosanzmtz
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c2ec7ff3152f1edb4fcf56cfa03ebbedbb9cb851 -
Trigger Event:
push
-
Statement type:
File details
Details for the file srtm-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: srtm-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 417.3 kB
- Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13a2d6091aad253b8e68ba97b90d61654532ca49b477f5c39466e6e1e18c558f
|
|
| MD5 |
e9b6691cb4c948010cd480ae18a906e6
|
|
| BLAKE2b-256 |
4c1726e3e6f4fe562a30ee214b13d40f4dccb1b38ee3edf084748ac9e13b71ae
|
Provenance
The following attestation bundles were made for srtm-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl:
Publisher:
release.yml on pedrosanzmtz/htg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
srtm-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl -
Subject digest:
13a2d6091aad253b8e68ba97b90d61654532ca49b477f5c39466e6e1e18c558f - Sigstore transparency entry: 774339199
- Sigstore integration time:
-
Permalink:
pedrosanzmtz/htg@c2ec7ff3152f1edb4fcf56cfa03ebbedbb9cb851 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pedrosanzmtz
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c2ec7ff3152f1edb4fcf56cfa03ebbedbb9cb851 -
Trigger Event:
push
-
Statement type:
File details
Details for the file srtm-0.2.0-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: srtm-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 368.1 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e0cbec42a5c3402bc2cad58674f8ec2d981d58c755cfee841e97b6b0ed2d155
|
|
| MD5 |
4e5c0212a355d0b4c82ab4353dbd7da7
|
|
| BLAKE2b-256 |
f6c417ba687ba69f115bc7215536f7c35c8feb6522f5cc1a12baa886658bbd0b
|
Provenance
The following attestation bundles were made for srtm-0.2.0-cp312-cp312-macosx_11_0_arm64.whl:
Publisher:
release.yml on pedrosanzmtz/htg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
srtm-0.2.0-cp312-cp312-macosx_11_0_arm64.whl -
Subject digest:
6e0cbec42a5c3402bc2cad58674f8ec2d981d58c755cfee841e97b6b0ed2d155 - Sigstore transparency entry: 774339197
- Sigstore integration time:
-
Permalink:
pedrosanzmtz/htg@c2ec7ff3152f1edb4fcf56cfa03ebbedbb9cb851 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pedrosanzmtz
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c2ec7ff3152f1edb4fcf56cfa03ebbedbb9cb851 -
Trigger Event:
push
-
Statement type: