Missing Elevation Data on specified area

Hey, I’m using Graphhopper Webservice with elevation data provided by srtm.
I noticed that there is a specific place where returned route has missing elevation (0 value).

1SS (My elevation graph)

2SS (Same route and elevation graph - with missing data, using your service)

So the question is what type of elevation data provider do you use in your server ?
I tried with this setup:

graph.elevation.provider: multi
graph.elevation.calc_mean: true
graph.elevation.smoothing: true

but when running .jar it throws error:

2021-02-01 13:05:40.759 [main] INFO i.d.server.DefaultServerFactory - Registering jersey handler with root path prefix: /
2021-02-01 13:05:40.763 [main] INFO i.d.server.DefaultServerFactory - Registering admin handler with root path prefix: /
2021-02-01 13:05:40.967 [main] INFO i.d.b.assets.ConfiguredAssetsBundle - Registering ConfiguredAssetBundle with name: assets for path /webjars/*
2021-02-01 13:05:40.967 [main] INFO i.d.b.assets.ConfiguredAssetsBundle - Registering ConfiguredAssetBundle with name: assets for path /maps/*
2021-02-01 13:05:40.968 [main] WARN i.d.jetty.setup.ServletEnvironment - Overriding the existing servlet registered with the name: assets
2021-02-01 13:05:41.015 [main] INFO io.dropwizard.server.ServerFactory - Starting GraphHopperApplication
_ _
__ _ _ __ __ _ _ __ | |__ | |__ ___ _ __ _ __ ___ _ __
/ | '__/ _ | ’ | '_ | '_ \ / _ | '_ | '_ \ / _ \ '|
| (| | | | (| | |) | | | | | | | () | |) | |) | / |
_, || _,| .
/|| ||| ||_
/| ./| ./ _||
|
/ || || |_|
2021-02-01 13:05:41.094 [main] INFO o.e.jetty.setuid.SetUIDListener - Opened application@518bfd90{HTTP/1.1, (http/1.1)}{localhost:8989}
2021-02-01 13:05:41.095 [main] INFO o.e.jetty.setuid.SetUIDListener - Opened admin@317a118b{HTTP/1.1, (http/1.1)}{localhost:8990}
2021-02-01 13:05:41.097 [main] INFO org.eclipse.jetty.server.Server - jetty-9.4.35.v20201120; built: 2020-11-20T21:17:03.964Z; git: bdc54f03a5e0a7e280fab27f55c3c75ee8da89fb; jvm 11.0.7+10
2021-02-01 13:05:41.133 [main] INFO c.g.reader.osm.GraphHopperOSM - version 2.3|2020-11-27T01:14:45Z (5,16,4,3,5,6)
2021-02-01 13:05:41.137 [main] INFO c.g.reader.osm.GraphHopperOSM - graph CH|car,hike|RAM_STORE|3D|no_turn_cost|, details:edges:0(0MB), nodes:0(0MB), name:(0MB), geo:0(0MB), bounds:1.7976931348623157E308,-1.7976931348623157E308,1.7976931348623157E308,-1.7976931348623157E308,1.7976931348623157E308,-1.7976931348623157E308, CHGraph|hike|NODE_BASED, shortcuts:0, nodesCH:(0MB)
2021-02-01 13:05:41.165 [main] INFO c.g.reader.osm.GraphHopperOSM - start creating graph from map.osm.pbf
2021-02-01 13:05:41.165 [main] INFO c.g.reader.osm.GraphHopperOSM - using CH|car,hike|RAM_STORE|3D|no_turn_cost|, memory:totalMB:256, usedMB:17
2021-02-01 13:05:41.165 [main] INFO com.graphhopper.reader.osm.OSMReader - Starting to process OSM file: ‘map.osm.pbf’
2021-02-01 13:05:47.429 [main] INFO com.graphhopper.reader.osm.OSMReader - creating graph. Found nodes (pillar+tower):2 441 914, totalMB:1478, usedMB:873
2021-02-01 13:05:47.440 [main] INFO c.g.reader.dem.CGIARProvider - cgiar Elevation Provider, from: http://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/TIFF/, to: /Users/x/Downloads/folder bez nazwy/srtmprovider, as: MMAP_STORE using interpolate: true
Exception in thread “PBF Reader” java.lang.RuntimeException: Unable to read PBF file.
at com.graphhopper.reader.osm.pbf.PbfReader.run(PbfReader.java:50)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.RuntimeException: java.lang.InterruptedException
at com.graphhopper.reader.osm.OSMInputFile.process(OSMInputFile.java:253)
at com.graphhopper.reader.osm.pbf.PbfDecoder.sendResultsToSink(PbfDecoder.java:96)
at com.graphhopper.reader.osm.pbf.PbfDecoder.processBlobs(PbfDecoder.java:151)
at com.graphhopper.reader.osm.pbf.PbfDecoder.run(PbfDecoder.java:162)
at com.graphhopper.reader.osm.pbf.PbfReader.run(PbfReader.java:47)
… 1 more
Caused by: java.lang.InterruptedException
at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2056)
at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2090)
at java.base/java.util.concurrent.LinkedBlockingQueue.put(LinkedBlockingQueue.java:341)
at com.graphhopper.reader.osm.OSMInputFile.process(OSMInputFile.java:251)
… 5 more
2021-02-01 13:05:48.945 [main] ERROR io.dropwizard.cli.ServerCommand - Unable to start server, shutting down
java.lang.RuntimeException: Couldn’t process file map.osm.pbf, error: Can’t decode srtm_41_02.tif
at com.graphhopper.reader.osm.OSMReader.writeOsmToGraph(OSMReader.java:296)
at com.graphhopper.reader.osm.OSMReader.readGraph(OSMReader.java:147)
at com.graphhopper.GraphHopper.importData(GraphHopper.java:697)
at com.graphhopper.GraphHopper.readData(GraphHopper.java:676)
at com.graphhopper.GraphHopper.process(GraphHopper.java:663)
at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:628)
at com.graphhopper.http.GraphHopperManaged.start(GraphHopperManaged.java:125)
at io.dropwizard.lifecycle.JettyManaged.doStart(JettyManaged.java:27)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
at org.eclipse.jetty.server.Server.start(Server.java:423)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
at org.eclipse.jetty.server.Server.doStart(Server.java:387)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
at io.dropwizard.cli.ServerCommand.run(ServerCommand.java:53)
at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:45)
at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:87)
at io.dropwizard.cli.Cli.run(Cli.java:78)
at io.dropwizard.Application.run(Application.java:94)
at com.graphhopper.http.GraphHopperApplication.main(GraphHopperApplication.java:36)
Caused by: java.lang.RuntimeException: Can’t decode srtm_41_02.tif
at com.graphhopper.reader.dem.CGIARProvider.generateRasterFromFile(CGIARProvider.java:112)
at com.graphhopper.reader.dem.AbstractTiffElevationProvider.getEle(AbstractTiffElevationProvider.java:136)
at com.graphhopper.reader.dem.MultiSourceElevationProvider.getEle(MultiSourceElevationProvider.java:52)
at com.graphhopper.reader.osm.OSMReader.getElevation(OSMReader.java:527)
at com.graphhopper.reader.osm.OSMReader.addNode(OSMReader.java:503)
at com.graphhopper.reader.osm.OSMReader.processNode(OSMReader.java:481)
at com.graphhopper.reader.osm.OSMReader.writeOsmToGraph(OSMReader.java:263)
… 20 common frames omitted
Caused by: java.io.EOFException: null
at org.apache.xmlgraphics.image.codec.util.SeekableStream.readUnsignedShort(SeekableStream.java:483)
at org.apache.xmlgraphics.image.codec.tiff.TIFFDirectory.getNumDirectories(TIFFDirectory.java:590)
at org.apache.xmlgraphics.image.codec.tiff.TIFFImageDecoder.getNumPages(TIFFImageDecoder.java:81)
at org.apache.xmlgraphics.image.codec.tiff.TIFFImageDecoder.decodeAsRenderedImage(TIFFImageDecoder.java:85)
at org.apache.xmlgraphics.image.codec.util.ImageDecoderImpl.decodeAsRaster(ImageDecoderImpl.java:136)
at org.apache.xmlgraphics.image.codec.util.ImageDecoderImpl.decodeAsRaster(ImageDecoderImpl.java:122)
at com.graphhopper.reader.dem.CGIARProvider.generateRasterFromFile(CGIARProvider.java:110)
… 26 common frames omitted
java.lang.RuntimeException: Couldn’t process file map.osm.pbf, error: Can’t decode srtm_41_02.tif
at com.graphhopper.reader.osm.OSMReader.writeOsmToGraph(OSMReader.java:296)
at com.graphhopper.reader.osm.OSMReader.readGraph(OSMReader.java:147)
at com.graphhopper.GraphHopper.importData(GraphHopper.java:697)
at com.graphhopper.GraphHopper.readData(GraphHopper.java:676)
at com.graphhopper.GraphHopper.process(GraphHopper.java:663)
at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:628)
at com.graphhopper.http.GraphHopperManaged.start(GraphHopperManaged.java:125)
at io.dropwizard.lifecycle.JettyManaged.doStart(JettyManaged.java:27)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
at org.eclipse.jetty.server.Server.start(Server.java:423)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
at org.eclipse.jetty.server.Server.doStart(Server.java:387)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
at io.dropwizard.cli.ServerCommand.run(ServerCommand.java:53)
at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:45)
at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:87)
at io.dropwizard.cli.Cli.run(Cli.java:78)
at io.dropwizard.Application.run(Application.java:94)
at com.graphhopper.http.GraphHopperApplication.main(GraphHopperApplication.java:36)
Caused by: java.lang.RuntimeException: Can’t decode srtm_41_02.tif
at com.graphhopper.reader.dem.CGIARProvider.generateRasterFromFile(CGIARProvider.java:112)
at com.graphhopper.reader.dem.AbstractTiffElevationProvider.getEle(AbstractTiffElevationProvider.java:136)
at com.graphhopper.reader.dem.MultiSourceElevationProvider.getEle(MultiSourceElevationProvider.java:52)
at com.graphhopper.reader.osm.OSMReader.getElevation(OSMReader.java:527)
at com.graphhopper.reader.osm.OSMReader.addNode(OSMReader.java:503)
at com.graphhopper.reader.osm.OSMReader.processNode(OSMReader.java:481)
at com.graphhopper.reader.osm.OSMReader.writeOsmToGraph(OSMReader.java:263)
… 20 more
Caused by: java.io.EOFException
at org.apache.xmlgraphics.image.codec.util.SeekableStream.readUnsignedShort(SeekableStream.java:483)
at org.apache.xmlgraphics.image.codec.tiff.TIFFDirectory.getNumDirectories(TIFFDirectory.java:590)
at org.apache.xmlgraphics.image.codec.tiff.TIFFImageDecoder.getNumPages(TIFFImageDecoder.java:81)
at org.apache.xmlgraphics.image.codec.tiff.TIFFImageDecoder.decodeAsRenderedImage(TIFFImageDecoder.java:85)
at org.apache.xmlgraphics.image.codec.util.ImageDecoderImpl.decodeAsRaster(ImageDecoderImpl.java:136)
at org.apache.xmlgraphics.image.codec.util.ImageDecoderImpl.decodeAsRaster(ImageDecoderImpl.java:122)
at com.graphhopper.reader.dem.CGIARProvider.generateRasterFromFile(CGIARProvider.java:110)
… 26 more

Moreover, when I run service with only

graph.elevation.provider: srtm

It works fine, but still is missing elevation data at specified area.

SRTM contains gaps, yes. CGIAR tried to fill them.

In your log the following appeared:

java.lang.RuntimeException: Couldn’t process file map.osm.pbf, error: Can’t decode srtm_41_02.tif

Can you remove this file and try a different provider? See Error when importing planet .osm.pbf

1 Like

Thank you for linking other topic. That was it !
I kept the osm data the same but used following config file:
graph.elevation.provider: cgiar
graph.elevation.base_url: https://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/TIFF/

now, as you mentioned received data contains that elevation data which previously was missing.
I think I will end up with this but I am curious benefits of using multi provider.
Did you put somewhere link base url for gmted ? Its neccessary to set both for cgiar and gmted when running service.

@karussell
Is there any solution to run clean web service with muliti provder ?
As we know something happend to cgiar url. It needs https to work.
It’s fine when we want to use only one provider but crashes with multi.

I guess, default url addresses for CGIAR and GMTED are used when in config file looks like:
graph.elevation.provider: multi
graph.elevation.calc_mean: true
graph.elevation.smoothing: true

so we can specify
graph.elevation.base_url:https://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/TIFF/;{missing url for GMTED}
but we need the GMTED url.

Is he public or not accessible ?

Thank you in advance !

Powered by Discourse