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

Error when fetching #15

Open Khalilsqu opened 3 years ago

Khalilsqu commented 3 years ago

Thanks for this exceptional library,

would you help why I get this error,

HTTPError: 400 Client Error: 400 for url: https://portal.opentopography.org/API/globaldem?demtype=SRTMGL3&south=5&north=45&west=10&east=70&outputFormat=GTiff

This is the code snippet.

topo = Topography(
    dem_type="SRTMGL3",
    south=5,
    north=45,
    west=10,
    east=70,
    output_format="GTiff",
    cache_dir="."
    )

fname = topo.fetch()
print(fname)
mdpiper commented 3 years ago

Hi @Khalilsqu -- thanks for reporting this issue. When I (via a tip from @mcflugen) entered the request URL generated by Topography

https://portal.opentopography.org/API/globaldem?demtype=SRTMGL3&south=5&north=45&west=10&east=70&outputFormat=GTiff

into my browser, I got a helpful error message from OpenTopography:

<error>
Error: The maximum area for SRTMGL3 is 4,050,000 km2. The selected area is 29,549,914 km2
</error>

I'm reopening this issue because I think it would be a good feature for Topography to warn a user when creating an instance that they're requesting an area greater than the max size supported by OpenTopography.

Please let me know if you run into any other issues; I'd like to continue improving this library!

Khalilsqu commented 3 years ago

Indeed, I figured out later the issue is related to the selected maximum area, and thus closed the report here!

Thanks again for your efforts.