Remove output.

This commit is contained in:
Holt59 2018-02-25 21:40:20 +01:00
parent 05c4f0da2a
commit 20a64255aa

View File

@ -29,22 +29,38 @@ public class BinaryGraphReader extends BinaryReader implements GraphReader {
*/
public static RoadType toRoadType(char ch) {
switch (ch) {
case 'a': return RoadType.MOTORWAY;
case 'b': return RoadType.TRUNK;
case 'c': return RoadType.PRIMARY;
case 'd': return RoadType.SECONDARY;
case 'e': return RoadType.MOTORWAY_LINK;
case 'f': return RoadType.TRUNK_LINK;
case 'g': return RoadType.PRIMARY_LINK;
case 'h': return RoadType.SECONDARY_LINK;
case 'i': return RoadType.TERTIARY;
case 'j': return RoadType.RESIDENTIAL;
case 'k': return RoadType.UNCLASSIFIED;
case 'l': return RoadType.ROAD;
case 'm': return RoadType.LIVING_STREET;
case 'n': return RoadType.SERVICE;
case 'o': return RoadType.ROUNDABOUT;
case 'z': return RoadType.COASTLINE;
case 'a':
return RoadType.MOTORWAY;
case 'b':
return RoadType.TRUNK;
case 'c':
return RoadType.PRIMARY;
case 'd':
return RoadType.SECONDARY;
case 'e':
return RoadType.MOTORWAY_LINK;
case 'f':
return RoadType.TRUNK_LINK;
case 'g':
return RoadType.PRIMARY_LINK;
case 'h':
return RoadType.SECONDARY_LINK;
case 'i':
return RoadType.TERTIARY;
case 'j':
return RoadType.RESIDENTIAL;
case 'k':
return RoadType.UNCLASSIFIED;
case 'l':
return RoadType.ROAD;
case 'm':
return RoadType.LIVING_STREET;
case 'n':
return RoadType.SERVICE;
case 'o':
return RoadType.ROUNDABOUT;
case 'z':
return RoadType.COASTLINE;
}
return RoadType.UNCLASSIFIED;
}
@ -61,8 +77,6 @@ public class BinaryGraphReader extends BinaryReader implements GraphReader {
@Override
public Graph read() throws IOException {
System.out.println(getClass());
// Read and check magic number and file version.
checkMagicNumberOrThrow(dis.readInt());
checkVersionOrThrow(dis.readInt());
@ -85,8 +99,8 @@ public class BinaryGraphReader extends BinaryReader implements GraphReader {
// Read nodes.
for (int node = 0; node < nbNodes; ++node) {
float longitude = ((float)dis.readInt ()) / 1E6f;
float latitude = ((float)dis.readInt ()) / 1E6f;
float longitude = ((float) dis.readInt()) / 1E6f;
float latitude = ((float) dis.readInt()) / 1E6f;
nbSuccessors[node] = dis.readUnsignedByte();
nodes.add(new Node(node, new Point(longitude, latitude)));
}
@ -134,8 +148,7 @@ public class BinaryGraphReader extends BinaryReader implements GraphReader {
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());
@ -173,8 +186,8 @@ public class BinaryGraphReader extends BinaryReader implements GraphReader {
* @throws IOException
*/
private RoadInformation readRoadInformation() throws IOException {
char type = (char)dis.readUnsignedByte();
int x = dis.readUnsignedByte() ;
char type = (char) dis.readUnsignedByte();
int x = dis.readUnsignedByte();
return new RoadInformation(toRoadType(type), (x & 0x80) > 0, (x & 0x7F) * 5, dis.readUTF());
}