Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new OT global raster datasets #55

Open
mdpiper opened this issue Sep 7, 2023 · 2 comments
Open

Add new OT global raster datasets #55

mdpiper opened this issue Sep 7, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@mdpiper
Copy link
Member

mdpiper commented Sep 7, 2023

OpenTopography has made available two more global raster datasets:

  • EU_DTM (DTM 30m)
  • GEDI_L3 (DTM 1000m)

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

@mdpiper mdpiper added the enhancement New feature or request label Sep 7, 2023
@Witold1
Copy link

Witold1 commented Jan 14, 2024

Affected line(s):

  1. VALID_DEM_TYPES = (
    "SRTMGL3",
    "SRTMGL1",
  2. if dem_type in Topography.VALID_DEM_TYPES:
    self._dem_type = dem_type
    else:
    raise ValueError(
    "dem_type must be one of %s." % (Topography.VALID_DEM_TYPES,)
    )
  3. bmi-topography/README.md

    Lines 14 to 18 in 993df5f

    The *bmi-topography* library provides access to the following global raster datasets:
    * SRTMGL3 (SRTM GL3 90m)
    * SRTMGL1 (SRTM GL1 30m)
    * SRTMGL1_E (SRTM GL1 Ellipsoidal 30m)

* 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
Copy link

Witold1 commented Jan 17, 2024

@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):

  • CENTER_LAT = 40.0
    CENTER_LON = -105.0
    WIDTH = 0.01
  • def test_fetch_load(tmpdir, dem_type, output_format, file_type):
    with tmpdir.as_cwd():
    topo = Topography(
    dem_type=dem_type,
    output_format=output_format,
    south=CENTER_LAT - WIDTH,
    west=CENTER_LON - WIDTH,
    north=CENTER_LAT + WIDTH,
    east=CENTER_LON + WIDTH,
    cache_dir=".",
    )
    topo.fetch()
    assert len(tmpdir.listdir(fil=lambda f: f.ext == "." + file_type)) == 1
    topo.load()
    assert topo.da is not None
    assert topo.da.name == dem_type
    assert topo.da.attrs["units"] is not None

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants