Metadata-Version: 2.1
Name: srtm-dl
Version: 0.0.5
Summary: A Python library (multi-threaded) for retrieving SRTM elevation map of CGIAR-CSI
Author-email: Ghasem Abdi <ghasem.abdi@yahoo.com>
License: MIT License
        
        Copyright (c) [2022] [Ghasem Abdi]
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/Abdi-Ghasem/srtmDownloader
Project-URL: Bug Tracker, https://github.com/Abdi-Ghasem/srtmDownloader/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE

<div align="center">

# **Python library (multi-threaded) for retrieving SRTM elevation map of [CGIAR-CSI](https://srtm.csi.cgiar.org/).**

</div>

**This is a Python library (multi-threaded), named 'srtm', for retrieving SRTM elevation map of [CGIAR-CSI](https://srtm.csi.cgiar.org/). SRTM elevation map is retrieved by using of:** 

<div>

```python
# 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')
```

```python
# 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]
```

```python
# (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]
```

</div>
