NaN value for motorcycle-curvature not allowed!

Hi, I have a problem importing PBF file using (GH v0.13.0):
**./graphhopper.sh -a web -i europe-latest.osm.pbf **
in config I have this flag_encoders:
graph.flag_encoders: car,foot,bike,motorcycle

How can I resume the import of PBF file?

Can anyone help me with this error, I’m not sure if is related with the long Russian name or is about motorcycle-curvature?

2020-03-01 19:21:56.552 [main] INFO  com.graphhopper.search.NameIndex - Way name is too long: «Брянск — Смоленск до границы Республики Беларусь (через Рудню, на Витебск)» — Хиславичи — граница Республики Беларусь» — Владимировка, 66Н-2208 truncated to «Брянск — Смоленск до границы Республики Беларусь (через Рудню, 
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.lang.Thread.run(Thread.java:748)
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.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1220)
	at java.util.concurrent.locks.ReentrantLock.lockInterruptibly(ReentrantLock.java:335)
	at java.util.concurrent.LinkedBlockingQueue.put(LinkedBlockingQueue.java:339)
	at com.graphhopper.reader.osm.OSMInputFile.process(OSMInputFile.java:251)
	... 5 more
2020-03-01 19:26:19.315 [main] ERROR io.dropwizard.cli.ServerCommand - Unable to start server, shutting down
java.lang.RuntimeException: Couldn't process file europe-latest.osm.pbf, error: NaN value for motorcycle-curvature not allowed!
	at com.graphhopper.reader.osm.OSMReader.writeOsm2Graph(OSMReader.java:294)
	at com.graphhopper.reader.osm.OSMReader.readGraph(OSMReader.java:146)
	at com.graphhopper.GraphHopper.importData(GraphHopper.java:667)
	at com.graphhopper.GraphHopper.process(GraphHopper.java:638)
	at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:616)
	at com.graphhopper.http.GraphHopperManaged.start(GraphHopperManaged.java:74)
	at io.dropwizard.lifecycle.JettyManaged.doStart(JettyManaged.java:27)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
	at org.eclipse.jetty.server.Server.start(Server.java:418)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:119)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
	at org.eclipse.jetty.server.Server.doStart(Server.java:382)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at io.dropwizard.cli.ServerCommand.run(ServerCommand.java:53)
	at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:44)
	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:93)
	at com.graphhopper.http.GraphHopperApplication.main(GraphHopperApplication.java:34)
Caused by: java.lang.IllegalArgumentException: NaN value for motorcycle-curvature not allowed!
	at com.graphhopper.routing.profiles.UnsignedDecimalEncodedValue.setDecimal(UnsignedDecimalEncodedValue.java:62)
	at com.graphhopper.storage.BaseGraph$CommonEdgeIterator.set(BaseGraph.java:1280)
	at com.graphhopper.routing.util.MotorcycleFlagEncoder.applyWayTags(MotorcycleFlagEncoder.java:257)
	at com.graphhopper.routing.util.EncodingManager.applyWayTags(EncodingManager.java:650)
	at com.graphhopper.reader.osm.OSMReader.processWay(OSMReader.java:408)
	at com.graphhopper.reader.osm.OSMReader.writeOsm2Graph(OSMReader.java:270)
	... 19 common frames omitted
java.lang.RuntimeException: Couldn't process file europe-latest.osm.pbf, error: NaN value for motorcycle-curvature not allowed!
	at com.graphhopper.reader.osm.OSMReader.writeOsm2Graph(OSMReader.java:294)
	at com.graphhopper.reader.osm.OSMReader.readGraph(OSMReader.java:146)
	at com.graphhopper.GraphHopper.importData(GraphHopper.java:667)
	at com.graphhopper.GraphHopper.process(GraphHopper.java:638)
	at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:616)
	at com.graphhopper.http.GraphHopperManaged.start(GraphHopperManaged.java:74)
	at io.dropwizard.lifecycle.JettyManaged.doStart(JettyManaged.java:27)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
	at org.eclipse.jetty.server.Server.start(Server.java:418)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:119)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
	at org.eclipse.jetty.server.Server.doStart(Server.java:382)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at io.dropwizard.cli.ServerCommand.run(ServerCommand.java:53)
	at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:44)
	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:93)
	at com.graphhopper.http.GraphHopperApplication.main(GraphHopperApplication.java:34)
Caused by: java.lang.IllegalArgumentException: NaN value for motorcycle-curvature not allowed!
	at com.graphhopper.routing.profiles.UnsignedDecimalEncodedValue.setDecimal(UnsignedDecimalEncodedValue.java:62)
	at com.graphhopper.storage.BaseGraph$CommonEdgeIterator.set(BaseGraph.java:1280)
	at com.graphhopper.routing.util.MotorcycleFlagEncoder.applyWayTags(MotorcycleFlagEncoder.java:257)
	at com.graphhopper.routing.util.EncodingManager.applyWayTags(EncodingManager.java:650)
	at com.graphhopper.reader.osm.OSMReader.processWay(OSMReader.java:408)
	at com.graphhopper.reader.osm.OSMReader.writeOsm2Graph(OSMReader.java:270)
	... 19 more

This seems to be a bug but it is also a bit strange as it would mean the edge distance is 0.

Can you put a try-catch around the applyWayTags and print the way.toString() and edge.getDistance() here?

After encapsulating into a try/catch as @karussell suggested I get this error:

2020-03-02 17:26:54.782 [main] INFO  com.graphhopper.search.NameIndex - Way name is too long: «Брянск — Смоленск до границы Республики Беларусь (через Рудню, на Витебск)» — Хиславичи — граница Республики Беларусь» — Владимировка, 66Н-2208 truncated to «Брянск — Смоленск до границы Республики Беларусь (через Рудню, 
2020-03-02 17:30:14.133 [main] INFO  com.graphhopper.reader.osm.OSMReader - finished Way id:107040003, nodes:2, tags:{estimated_distance=0.0, ref=N285, bicycle=no, name=Nieuwe Bredase Baan, maxspeed=80, highway=primary, estimated_center=51.62852205250834,4.76784828531403} processing. nodes: 77103865, osmIdMap.size:520282413, osmIdMap:6127MB, nodeFlagsMap.size:1561653, relFlagsMap.size:3763587, zeroCounter:255071 totalMB:15627, usedMB:15160
2020-03-02 17:30:14.485 [main] INFO  com.graphhopper.reader.osm.OSMReader - finished 0.0 processing. nodes: 77103865, osmIdMap.size:520282413, osmIdMap:6127MB, nodeFlagsMap.size:1561653, relFlagsMap.size:3763587, zeroCounter:255071 totalMB:15627, usedMB:15160
Exception in thread "PBF Reader" java.lang.OutOfMemoryError: GC overhead limit exceeded
	at java.util.concurrent.LinkedBlockingQueue.put(LinkedBlockingQueue.java:336)
	at com.graphhopper.reader.osm.OSMInputFile.process(OSMInputFile.java:251)
	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)
	at java.lang.Thread.run(Thread.java:748)
2020-03-02 17:33:44.701 [main] INFO  com.graphhopper.reader.osm.OSMReader - finished way processing. nodes: 77322133, osmIdMap.size:520296046, osmIdMap:6127MB, nodeFlagsMap.size:1561653, relFlagsMap.size:3763587, zeroCounter:268384 totalMB:15627, usedMB:15245
2020-03-02 17:34:04.765 [main] INFO  com.graphhopper.reader.osm.OSMReader - time pass1:2216s, pass2:6150s, total:8366s
2020-03-02 17:34:04.809 [main] INFO  c.g.r.s.PrepareRoutingSubnetworks - start finding subnetworks (min:200, min one way:200) totalMB:15627, usedMB:10107

Maybe I will need to allocate more memory, now I’m using JAVA_OPTS:=-Xmx16000m -Xms16000m

Yes, seems to be a different local issue. Also it seems the problematic zero-length way was already removed from @ratrun :slight_smile:

With 32GB of RAM it looks better, maybe it was a problem on my side only, thank you for help.

2020-03-03 04:43:48.033 [main] WARN  com.graphhopper.reader.osm.OSMReader - Parsing error in way with OSMID=529931376 : Cannot parse duration tag value: 1,5 Horas (ida e volta)
2020-03-03 04:43:48.033 [main] WARN  com.graphhopper.reader.osm.OSMReader - Parsing error in way with OSMID=529931377 : Cannot parse duration tag value: 1,5 Horas (ida e volta)
2020-03-03 04:44:48.581 [main] INFO  com.graphhopper.search.NameIndex - Way name is too long: "Сатинка - Медное - "Тамбов - Пенза" - Рассказово - Уварово - Мучкапский" - Осино-Лазовка - "Тамбов - Пенза" - Рассказово - Уварово - Мучкапский" - Чакино - Сампур", 68Н-064 truncated to "Сатинка - Медное - "Тамбов - Пенза" - Рассказово - Уварово - Му
2020-03-03 04:54:38.136 [main] INFO  com.graphhopper.search.NameIndex - Way name is too long: «Беларусь» — от Москвы до границы с Республикой Беларусь (на Минск, Брест)» — Смогири — Болдино — «Витязи — Духовщина — Белый — Нелидово», 66Н-1019 truncated to «Беларусь» — от Москвы до границы с Республикой Беларусь (на Мин
2020-03-03 05:03:09.214 [main] WARN  com.graphhopper.reader.osm.OSMReader - Pillar node 6445793822 is already a tower node and used in loop, see #1533. Fix mapping for way 687607800, nodes:[6437109282, 6437109286, 6437109285, 6437109284, 6437109283, 6437109287, 6445793822, 6445793822, 6445793820, 6445793816, 6445793815]
2020-03-03 05:04:05.942 [main] WARN  com.graphhopper.reader.osm.OSMReader - Pillar node 6525094814 is already a tower node and used in loop, see #1533. Fix mapping for way 694775650, nodes:[6238137691, 6525094814, 6525094814, 6238137693, 7097956949, 6238187158, 6238137361, 6652815754, 6773057514, 6238137370]
2020-03-03 05:06:20.078 [main] INFO  com.graphhopper.search.NameIndex - Way name is too long: "Сатинка - Медное - "Тамбов - Пенза" - Рассказово - Уварово - Мучкапский" - Осино-Лазовка - "Тамбов - Пенза" - Рассказово - Уварово - Мучкапский" - Чакино - Сампур", 68Н-064 truncated to "Сатинка - Медное - "Тамбов - Пенза" - Рассказово - Уварово - Му
2020-03-03 05:06:53.181 [main] WARN  com.graphhopper.reader.osm.OSMReader - Parsing error in way with OSMID=730310212 : Cannot parse duration tag value: 02:30;03:30
2020-03-03 05:09:33.163 [main] WARN  com.graphhopper.reader.osm.OSMReader - Pillar node 7235216897 is already a tower node and used in loop, see #1533. Fix mapping for way 775561556, nodes:[7235213961, 7235213969, 7235213974, 7235213956, 7235213970, 7235216897, 7235216897, 7235213948, 7235216897, 7235213970, 7235213948, 7235216897, 7235213948, 7235213964]
2020-03-03 05:09:38.865 [main] INFO  com.graphhopper.reader.osm.OSMReader - 2 763 446 318, now parsing relations
2020-03-03 05:09:49.508 [main] INFO  com.graphhopper.reader.osm.OSMReader - finished way processing. nodes: 94405102, osmIdMap.size:521099339, osmIdMap:6136MB, nodeFlagsMap.size:1561653, relFlagsMap.size:3763587, zeroCounter:1056584 totalMB:28632, usedMB:26442
2020-03-03 05:10:08.911 [main] INFO  com.graphhopper.reader.osm.OSMReader - time pass1:2639s, pass2:15837s, total:18476s
2020-03-03 05:10:08.972 [main] INFO  c.g.r.s.PrepareRoutingSubnetworks - start finding subnetworks (min:200, min one way:200) totalMB:28632, usedMB:26447
2020-03-03 05:57:45.777 [main] INFO  c.g.r.s.PrepareRoutingSubnetworks - car-access|version=-318709518|bits=1|index=0|shift=24|store_both_directions=true findComponents time:2856.794, size:933972
2020-03-03 05:59:36.118 [main] INFO  c.g.r.s.PrepareRoutingSubnetworks - 20074650 subnetworks found for car, totalMB:28540, usedMB:14414
2020-03-03 06:36:47.916 [main] INFO  c.g.r.s.PrepareRoutingSubnetworks - foot-access|version=-793770610|bits=1|index=0|shift=31|store_both_directions=true findComponents time:2231.7935, size:639898
2020-03-03 06:37:41.052 [main] INFO  c.g.r.s.PrepareRoutingSubnetworks - 2595784 subnetworks found for foot, totalMB:27591, usedMB:14484
2020-03-03 07:21:51.083 [main] INFO  c.g.r.s.PrepareRoutingSubnetworks - bike-access|version=2076561951|bits=1|index=1|shift=8|store_both_directions=true findComponents time:2650.0303, size:921551
2020-03-03 07:22:41.644 [main] INFO  c.g.r.s.PrepareRoutingSubnetworks - 3585652 subnetworks found for bike, totalMB:27379, usedMB:17519

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Powered by Discourse