Giter Site home page Giter Site logo

Comments (2)

Witold1 avatar Witold1 commented on May 26, 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.

from bmi-topography.

Witold1 avatar Witold1 commented on May 26, 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)

from bmi-topography.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.