csdms / bmi-topography

Fetch and cache land elevation data from OpenTopography through an API, BMI, or CLI
https://bmi-topography.readthedocs.io
MIT License
10 stars 4 forks source link

Add new OT global raster datasets #55

Open mdpiper opened 1 year ago

mdpiper commented 1 year ago

OpenTopography has made available two more global raster datasets:

The Topography data component should be updated to access these new datasets.

Witold1 commented 10 months ago

Affected line(s):

  1. https://github.com/csdms/bmi-topography/blob/993df5faf4871ad716b38f87bb7ad0f3ddd08281/bmi_topography/topography.py#L34-L36
  2. https://github.com/csdms/bmi-topography/blob/993df5faf4871ad716b38f87bb7ad0f3ddd08281/bmi_topography/topography.py#L64-L69
  3. https://github.com/csdms/bmi-topography/blob/993df5faf4871ad716b38f87bb7ad0f3ddd08281/README.md?plain=1#L14-L18

* API error (simplified reproduction):

import requests

LINK = "https://portal.opentopography.org/API/globaldem?demtype=COP3012&south=30&north=50&west=20&east=30&outputFormat=GTiff&API_Key=demoapikeyot2022"

requests.get(LINK).text
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?><error>Error: Dataset COP3012 not found. Please check dataset name or ID.</error>

Reference: Actual list of datasets and values, OpenTopography.org API Docs (https://portal.opentopography.org/apidocs/) and from OpenTopography for Developers

Available global raster datasets:

- SRTMGL3 (SRTM GL3 90m)
- SRTMGL1 (SRTM GL1 30m)
- SRTMGL1_E (SRTM GL1 Ellipsoidal 30m)
- AW3D30 (ALOS World 3D 30m)
- AW3D30_E (ALOS World 3D Ellipsoidal, 30m)
- SRTM15Plus (Global Bathymetry SRTM15+ V2.1)
- NASADEM (NASADEM Global DEM)
- COP30 (Copernicus Global DSM 30m)
- COP90 (Copernicus Global DSM 90m)
- EU_DTM (DTM 30m)
- GEDI_L3 (DTM 1000m)

* All datasets require API key for access. Users can request an API key via myOpenTopo in the OpenTopography portal.
Available values : SRTMGL3, SRTMGL1, SRTMGL1_E, AW3D30, AW3D30_E, SRTM15Plus, NASADEM, COP30, COP90, EU_DTM, GEDI_L3

Example : SRTMGL3

Global datasets API RESTful Web service for accessing Shuttle Radar Topography Mission GL3 (Global 90m), GL1 (Global 30m), GL1 Ellipsoidal, ALOS World 3D (Global 30m), ALOS World 3D Ellipsoidal, Global Bathymetry and Topography at 15 Arc Sec: SRTM15+ V2.1, NASADEM (NASADEM Global DEM), COP30 (Copernicus Global DSM 30m), COP90 (Copernicus Global DSM 90m), Continental Europe Digital Terrain Model 30m and GEDI L3 (DTM 1000 meter) data. ^Accessed Jan 17/2024. I added NASADEM, COP30 and COP90 OpenTopography hyperlinks myself.

Witold1 commented 10 months ago

@mdpiper - EU_DTM (Continental Europe Digital Terrain Model 30m) dataset's boundaries, Europe itself, does not include test point location. So it returns an empty dataset and fails tests.

nox -s test <...> tests/test_topography.py::test_fetch_load[GTiff-tif-EU_DTM] FAILED <...> =========================== short test summary info ============================ FAILED tests/test_topography.py::test_fetch_load[GTiff-tif-EU_DTM] - rasterio.errors.RasterioIOError:

Affected line(s):

We may either skip this test(s), or use different test point area, or handle some specific test case for this respective dem, like this:

92 | CENTER_LAT, CENTER_LON = (47.0, 10.0) if dem_type == "EU_DTM" else (40.0, -105.0)