A Python library (multi-threaded) for retrieving SRTM elevation map of CGIAR-CSI
Project description
Python library (multi-threaded) for retrieving SRTM elevation map of CGIAR-CSI.
This is a Python library (multi-threaded), named 'srtm', for retrieving SRTM elevation map of CGIAR-CSI. SRTM elevation map is retrieved by using of:
# RETRIEVE SRTM DATA OVER AN AOI WITH RESPECT TO GEOID (ORTHOMETRIC HEIGHT)
import srtm
# Define the AOI
aoi = {'upper_left' : [48.07, -69.06],
'lower_right': [44.60, -63.77]}
# Retrieve, merge, and crop SRTM elevation map over the AOI
srtm.clip(aoi, save_path='/Users/ghasem.abdi/Desktop/nb_srtm.tif')
# RETRIEVE SRTM DATA OF A POINT WITH RESPECT TO GEOID (ORTHOMETRIC HEIGHT)
import rasterio
from srtm import srtm
# Define the point
lat, lon = 45.95, -66.65
# Retrieve SRTM elevation map of the point
srtm.retrieve((srtm.which_tile(lat, lon), '/Users/ghasem.abdi/Desktop/'))
# Open SRTM elevation map of the point
ds = rasterio.open('/Users/ghasem.abdi/Desktop/srtm_23_03.tif')
# Extract orthometric height of the point
orthometric_height = next(ds.sample([(lon, lat)]))[0]
# (OPTIONAL): CONVERT THE ORTHOMETRIC HEIGHT TO ELLIPSOIDAL HEIGHT
import pyproj
# WGS84 with Gravity-related height (EGM96)
geoid = pyproj.CRS('EPSG:4326+5773')
# WGS84 with ellipsoid height as vertical axis
ellipsoid = pyproj.CRS.from_epsg(4979)
# Define a transformation from orthometric to ellipsoidal system
trf = pyproj.Transformer.from_crs(geoid, ellipsoid)
# Estimate the ellipsoidal height
ellipsoidal_height = trf.transform(lat, lon, orthometric_height)[-1]
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
srtm_dl-0.0.5.tar.gz
(4.2 kB
view details)
Built Distribution
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_dl-0.0.5.tar.gz.
File metadata
- Download URL: srtm_dl-0.0.5.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
864d2a9948d41d46cd71bff12d738f3e792c931036e377b385a50996848ead92
|
|
| MD5 |
dc0ec415132841d26adcd3f6ce348c83
|
|
| BLAKE2b-256 |
00a972d42b3548a22765baf1989de0a2e8473a58634facac2b9278604a4d7820
|
File details
Details for the file srtm_dl-0.0.5-py3-none-any.whl.
File metadata
- Download URL: srtm_dl-0.0.5-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
125355c3150d74ac861fcc3d98f6e1d10b81934a8ee2578c4211417850764ffb
|
|
| MD5 |
070b3ebb1027172a71e75cf44903ae61
|
|
| BLAKE2b-256 |
0e5f38672244e1345e31f00839e3b8fa78bfb3b64d5233e7d0fa9b3cf5e3af24
|