graphhopper / graphhopper

Open source routing engine for OpenStreetMap. Use it as Java library or standalone web server.

Home Page:https://www.graphhopper.com/open-source/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix the exception handling for elevation download

Hypercookie opened this issue · comments

Describe the bug
When using the CGIARElevation provider, 0.0 will be returned for all queries.
This probably happens because the default base URL (https://srtm.csi.cgiar.org/) does time out now. (This is different from #2642). At least on my machine, this fails silently.
I don't know if this is only temporary or if this dataset has been removed.
To Reproduce

  1. Create an instance of CGIARElevation.
  2. Query the instance for any lat/long
  3. 0.0 will be returned.
  4. Look inside the cache folder. The files do exist, but they are corrupted

Expected behavior
The correct elevation should be returned. Or an exception must be thrown.

System Information

MacOS, OpenJDK 20.0.2, Graphopper 7.0

commented

Seems to be back up. But we need to fix the exception handling:

} catch (IOException ex) {
demProvider.setSeaLevel(true);
// use small size on disc and in-memory
heights.create(10).flush();
return 0;
}