Integrate access information in RoadInformation.

This commit is contained in:
Mikael Capelle
2018-03-01 13:33:56 +01:00
parent 0963f4a12f
commit 875a0c8518
5 changed files with 133 additions and 32 deletions

View File

@@ -154,7 +154,8 @@ public class BinaryGraphReaderInsa2018 extends BinaryReader implements GraphRead
float dlon = (dis.readShort()) / 2.0e5f;
float dlat = (dis.readShort()) / 2.0e5f;
points.add(new Point(lastPoint.getLongitude() + dlon, lastPoint.getLatitude() + dlat));
points.add(new Point(lastPoint.getLongitude() + dlon,
lastPoint.getLatitude() + dlat));
}
points.add(nodes.get(destNode).getPoint());
@@ -193,7 +194,12 @@ public class BinaryGraphReaderInsa2018 extends BinaryReader implements GraphRead
private RoadInformation readRoadInformation() throws IOException {
char type = (char) dis.readUnsignedByte();
int x = dis.readUnsignedByte();
return new RoadInformation(toRoadType(type), (x & 0x80) > 0, (x & 0x7F) * 5, dis.readUTF());
int access = 0xFF00;
if (getCurrentVersion() >= 6) {
access = dis.readUnsignedShort();
}
return new RoadInformation(toRoadType(type), access, (x & 0x80) > 0, (x & 0x7F) * 5,
dis.readUTF());
}
}