Open feludwig opened 11 months ago
The Bayern split accross 49th parallel was successful and the two files are
Bayern-above49.obf
625MB
Bayern-below49.obf
751MB
So the isssue is with input size...
Did you try pbf as input file cause it might work better as it tested more
No, but I'll go try that as well
Yes, it also crashes:
input: bayern-latest.osm.pbf
from geofabrik size: 712M
incomplete output: Bayern-latest.obf
size: 890M
Oct 16, 2023 5:26:23 PM net.osmand.obf.preparation.BinaryMapIndexWriter endWriteMapLevelIndex
INFO: MAP level SIZE : 12645757
Oct 16, 2023 5:26:23 PM net.osmand.obf.preparation.BinaryMapIndexWriter endWriteMapIndex
INFO: MAP INDEX SIZE : 927596053
INFO: Writing route index to binary file... started after 5174106 ms - -1
Oct 16, 2023 5:26:41 PM net.osmand.obf.preparation.IndexCreator generateIndexes
SEVERE: Log exception
java.lang.IndexOutOfBoundsException: Index -28761 out of bounds for length 58308
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
at java.base/java.util.Objects.checkIndex(Objects.java:372)
at java.base/java.util.ArrayList.get(ArrayList.java:459)
at net.osmand.osm.MapRoutingTypes.getTypeByInternalId(MapRoutingTypes.java:335)
at net.osmand.obf.preparation.IndexRouteCreator$RouteWriteContext.decodeNames(IndexRouteCreator.java:1337)
at net.osmand.obf.preparation.IndexRouteCreator$RouteWriteContext.retrieveObject(IndexRouteCreator.java:1382)
at net.osmand.obf.preparation.IndexRouteCreator.writeBinaryMapBlock(IndexRouteCreator.java:1532)
at net.osmand.obf.preparation.IndexRouteCreator.writeBinaryMapBlock(IndexRouteCreator.java:1594)
at net.osmand.obf.preparation.IndexRouteCreator.writeBinaryMapBlock(IndexRouteCreator.java:1594)
at net.osmand.obf.preparation.IndexRouteCreator.writeBinaryMapBlock(IndexRouteCreator.java:1594)
at net.osmand.obf.preparation.IndexRouteCreator.writeBinaryMapBlock(IndexRouteCreator.java:1594)
at net.osmand.obf.preparation.IndexRouteCreator.writeBinaryRouteIndexBlocks(IndexRouteCreator.java:1498)
at net.osmand.obf.preparation.IndexRouteCreator.writeRouteSections(IndexRouteCreator.java:743)
at net.osmand.obf.preparation.IndexRouteCreator.writeBinaryRouteIndex(IndexRouteCreator.java:704)
at net.osmand.obf.preparation.IndexCreator.generateIndexes(IndexCreator.java:631)
at net.osmand.obf.preparation.IndexCreator.generateIndexes(IndexCreator.java:484)
at net.osmand.MainUtilities.generateObf(MainUtilities.java:297)
at net.osmand.MainUtilities.main(MainUtilities.java:127)
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index -28761 out of bounds for length 58308
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
at java.base/java.util.Objects.checkIndex(Objects.java:372)
at java.base/java.util.ArrayList.get(ArrayList.java:459)
at net.osmand.osm.MapRoutingTypes.getTypeByInternalId(MapRoutingTypes.java:335)
at net.osmand.obf.preparation.IndexRouteCreator$RouteWriteContext.decodeNames(IndexRouteCreator.java:1337)
at net.osmand.obf.preparation.IndexRouteCreator$RouteWriteContext.retrieveObject(IndexRouteCreator.java:1382)
at net.osmand.obf.preparation.IndexRouteCreator.writeBinaryMapBlock(IndexRouteCreator.java:1532)
at net.osmand.obf.preparation.IndexRouteCreator.writeBinaryMapBlock(IndexRouteCreator.java:1594)
at net.osmand.obf.preparation.IndexRouteCreator.writeBinaryMapBlock(IndexRouteCreator.java:1594)
at net.osmand.obf.preparation.IndexRouteCreator.writeBinaryMapBlock(IndexRouteCreator.java:1594)
at net.osmand.obf.preparation.IndexRouteCreator.writeBinaryMapBlock(IndexRouteCreator.java:1594)
at net.osmand.obf.preparation.IndexRouteCreator.writeBinaryRouteIndexBlocks(IndexRouteCreator.java:1498)
at net.osmand.obf.preparation.IndexRouteCreator.writeRouteSections(IndexRouteCreator.java:743)
at net.osmand.obf.preparation.IndexRouteCreator.writeBinaryRouteIndex(IndexRouteCreator.java:704)
at net.osmand.obf.preparation.IndexCreator.generateIndexes(IndexCreator.java:631)
at net.osmand.obf.preparation.IndexCreator.generateIndexes(IndexCreator.java:484)
at net.osmand.MainUtilities.generateObf(MainUtilities.java:297)
at net.osmand.MainUtilities.main(MainUtilities.java:127)
We don't build bayern separately cause it might be too big, we build as separate regions but the crash is strange. It happens on the last stage...
Oh I see, so the workaround is something like
osmium extract
multiple smaller partsMapCreator generate-obf
MapCreator merge-index --address --poi
of all the small parts to get one .obf at the endYes that's what we do actually... processing large file is just takes too much memory and we even can run in parallel using 1 mapcreator batch utility and local docker
Hello! I have been trying to create
.obf
maps of.osm.bz2
extracts, andOsmAndMapCreator generate-obf
works well for the following:Switzerland.osm.bz2
(osm.bz2 692MB, obf 783MB) But it crashes whilewriting route index
when the input file is bigger than about 1GB (I am giving it -Xmx 25G of memory to use) on the following: (germany)baden-wuerttemberg-latest.osm.bz2
(osm.bz2 854MB, unfinished obf 696MB) (germany)bayern-latest.osm.bz2
(osm.bz2 1.2G, unfinished obf 889MB) Here is the end of the log for baden-wuerttemberg:(
IndexRouteCreator.java:1594
that line does appear 3 consecutive times) The two extracts from Germany are geofabrik extracts, because I was suspecting that the Bayern input I had was corrupted (it had crashed, at the same point). I have just split Bayern along 49 latitude and will start converting the two halves separately and report how it went. These extracts take more than 10h to convert so it was a bit of an adventure. I'm running the latest version from github:Do you also want logs for other and/or successful extracts ? Or the complete log ? Should I run the conversion, or compile MapCreator, again with some specific flags ?