Fix critical routing issue

This commit is contained in:
Victor Shcherb 2012-06-16 16:12:57 +02:00
parent e40cda90bb
commit 2c700f9917
4 changed files with 6 additions and 6 deletions

View file

@ -36,6 +36,7 @@ public class MapRoutingTypes {
TAGS_TO_SAVE.add("toll");
TAGS_TO_SAVE.add("tracktype");
TAGS_TO_SAVE.add("railway");
TAGS_TO_SAVE.add("construction");
}
private Map<String, MapRouteType> types = new LinkedHashMap<String, MapRoutingTypes.MapRouteType>();

View file

@ -221,6 +221,7 @@ public class BinaryRoutePlanner {
}
while (!graphSegments.isEmpty()) {
RouteSegment segment = graphSegments.poll();
System.out.println(segment.getRoad().getId() + " " + segment.segmentStart);
ctx.visitedSegments++;
// for debug purposes
if (ctx.visitor != null) {
@ -747,8 +748,8 @@ public class BinaryRoutePlanner {
// put additional information to recover whole route after
next.parentRoute = segment;
next.parentSegmentEnd = segmentEnd;
graphSegments.add(next);
}
graphSegments.add(next);
if (ctx.visitor != null) {
ctx.visitor.visitSegment(next, false);
}

View file

@ -44,7 +44,7 @@
<highway value="primary_link" speed="45" priority="1.1" dynamicPriority="1"/>
<!-- generally linking smaller towns and villages -->
<highway value="secondary" speed="50" priority="1.1" dynamicPriority="1.1"/>
<highway value="secondary" speed="60" priority="1.1" dynamicPriority="1.1"/>
<highway value="secondary_link" speed="40" priority="1" dynamicPriority="1"/>
<!-- important urban roads -->

View file

@ -48,8 +48,6 @@ bool skipUnknownFields(CodedInputStream* input, int tag) {
}
bool readMapTreeBounds(CodedInputStream* input, MapTreeBounds* tree, MapRoot* root) {
int init = 0;
int tag;
@ -1315,14 +1313,14 @@ BinaryMapFile* initBinaryMapFile(std::string inputName) {
FileInputStream input(fileno(file));
input.SetCloseOnDelete(false);
CodedInputStream cis(&input);
cis.SetTotalBytesLimit(INT_MAX, INT_MAX >> 2);
cis.SetTotalBytesLimit(INT_MAX, INT_MAX);
if (!initMapStructure(&cis, mapFile)) {
osmand_log_print(LOG_ERROR, "File not initialised : %s", inputName.c_str());
delete mapFile;
return NULL;
}
mapFile->inputName = inputName;
openFiles.insert(std::pair<std::string, BinaryMapFile*>(inputName, mapFile));
return mapFile;
}