[GraphHopper] Can't import planet with 0.5: java.lang.IllegalArgumentException: new capacity has to be strictly positive
Peter
graphhopper at gmx.de
Sat Aug 22 16:29:46 UTC 2015
Hi Jan,
I've opened this issue:
https://github.com/graphhopper/graphhopper/issues/500
How many flag encoders did you use? And do you have access limitations?
But we need to fix this anyway even if you find workarounds. So
increasing the 32-1 bits to 32 could help in the first place or to 5
bytes, but not for 0.5 as both of these changes require a storage format
change.
I wonder if you get the same problem for the same OSM file and 0.4.1 -
did you try this too?
Regards,
Peter
On 18.08.2015 09:40, Jan Torben Heuer wrote:
> Hi Peter, Hi List,
>
> I successfully imported the Berlin dataset, but I wasn’t able to process the planet file. Here is the relevant code and a full stack trace, can I provide anything else?
>
>
> List<String> sports = ...
> FlagEncoder flagEncoder = new ...
> List<FlagEncoder> flagEncoders = Collections.singletonList(flagEncoder);
> EncodingManager encodingManager = new EncodingManager(flagEncoders, 8);
>
> List<Weighting> weightings = sports.stream()
> .map(sport -> new ScoreWeighting(sport, flagEncoder, null))
> .collect(toList());
>
> GHDirectory directory = new GHDirectory(graphWorkDirectory.getAbsolutePath(), RAM_STORE);
>
> GraphHopperStorage storage = new GraphHopperStorage(weightings, directory, encodingManager, true, new GraphExtension.NoOpExtension());
> OSMReader reader = new KomootOSMReader(storage)
> .setOSMFile(osmFile)
> .setEncodingManager(encodingManager)
> .setWayPointMaxDistance(2);
> reader.readGraph();
>
>
>
> INFO main com.graphhopper.search.NameIndex: Way name is too long: ??????? ? ???????? ?? ??????? ?????????? ???????? (????? ?????, ?? ???????)? ? ???????? ? ??????????? ? ??????? ? ???????? ?? ??????? ?????????? ???????? (????? ?????, ?? ???????)? ? ?????? truncated to ??????? ? ???????? ?? ??????? ?????????? ???????? (????? ?????,
> ERROR main com.graphhopper.reader.OSMReader: Couldn't properly add edge with osm ids:{2383413585, 2383413105, 2383413689, 2383412860, 2383413734, 2383413298, 2383413028, 2383413339, 2383413782, 2383413709, 2383412992, 2376742330}
> java.lang.IllegalArgumentException: new capacity has to be strictly positive
> at com.graphhopper.storage.RAMDataAccess.ensureCapacity(RAMDataAccess.java:99) ~[graphhopper-0.5.0-RC1.jar!/:na]
> at com.graphhopper.storage.BaseGraph.ensureGeometry(BaseGraph.java:955) ~[graphhopper-0.5.0-RC1.jar!/:na]
> at com.graphhopper.storage.BaseGraph.setWayGeometry_(BaseGraph.java:842) ~[graphhopper-0.5.0-RC1.jar!/:na]
> at com.graphhopper.storage.BaseGraph.access$100(BaseGraph.java:45) ~[graphhopper-0.5.0-RC1.jar!/:na]
> at com.graphhopper.storage.BaseGraph$CommonEdgeIterator.setWayGeometry(BaseGraph.java:1277) ~[graphhopper-0.5.0-RC1.jar!/:na]
> at com.graphhopper.reader.OSMReader.addEdge(OSMReader.java:805) [graphhopper-0.5.0-RC1.jar!/:na]
> at com.graphhopper.reader.OSMReader.addOSMWay(OSMReader.java:731) [graphhopper-0.5.0-RC1.jar!/:na]
> at com.graphhopper.reader.OSMReader.processWay(OSMReader.java:433) [graphhopper-0.5.0-RC1.jar!/:na]
> at com.graphhopper.reader.OSMReader.writeOsm2Graph(OSMReader.java:303) [graphhopper-0.5.0-RC1.jar!/:na]
> at com.graphhopper.reader.OSMReader.readGraph(OSMReader.java:154) [graphhopper-0.5.0-RC1.jar!/:na]
> at [removed]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_20]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_20]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_20]
> at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_20]
> at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53) [importer.jar!/:na]
> at java.lang.Thread.run(Thread.java:745) [na:1.8.0_20]
> Exception in thread "PBF Reader" java.lang.RuntimeException: Unable to read PBF file.
> at com.graphhopper.reader.pbf.PbfReader.run(PbfReader.java:53)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.RuntimeException: java.lang.InterruptedException
> at com.graphhopper.reader.OSMInputFile.process(OSMInputFile.java:266)
> at com.graphhopper.reader.pbf.PbfDecoder.sendResultsToSink(PbfDecoder.java:107)
> at com.graphhopper.reader.pbf.PbfDecoder.processBlobs(PbfDecoder.java:172)
> at com.graphhopper.reader.pbf.PbfDecoder.run(PbfDecoder.java:185)
> at com.graphhopper.reader.pbf.PbfReader.run(PbfReader.java:49)
> ... 1 more
> Caused by: java.lang.InterruptedException
> at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2014)
> at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2048)
> at java.util.concurrent.LinkedBlockingQueue.put(LinkedBlockingQueue.java:350)
> at com.graphhopper.reader.OSMInputFile.process(OSMInputFile.java:263)
> ... 5 more
> java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:483)
> at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.RuntimeException: Couldn't process file /tmp/4234396441253231557.pbf, error: new capacity has to be strictly positive
> at com.graphhopper.reader.OSMReader.writeOsm2Graph(OSMReader.java:323)
> at com.graphhopper.reader.OSMReader.readGraph(OSMReader.java:154)
> at de.komoot.wanderwalter.importer.Import.importCHs(Import.java:222)
> at de.komoot.wanderwalter.importer.Import.importSports(Import.java:159)
> at de.komoot.wanderwalter.importer.Import.run(Import.java:120)
> at de.komoot.wanderwalter.importer.Import.main(Import.java:249)
> ... 6 more
> Caused by: java.lang.IllegalArgumentException: new capacity has to be strictly positive
> at com.graphhopper.storage.RAMDataAccess.ensureCapacity(RAMDataAccess.java:99)
> at com.graphhopper.storage.BaseGraph.ensureGeometry(BaseGraph.java:955)
> at com.graphhopper.storage.BaseGraph.setWayGeometry_(BaseGraph.java:842)
> at com.graphhopper.storage.BaseGraph.access$100(BaseGraph.java:45)
> at com.graphhopper.storage.BaseGraph$CommonEdgeIterator.setWayGeometry(BaseGraph.java:1277)
> at com.graphhopper.reader.OSMReader.addEdge(OSMReader.java:805)
> at com.graphhopper.reader.OSMReader.addOSMWay(OSMReader.java:731)
> at com.graphhopper.reader.OSMReader.processWay(OSMReader.java:433)
> at com.graphhopper.reader.OSMReader.writeOsm2Graph(OSMReader.java:303)
> ... 11 more
>
More information about the GraphHopper
mailing list