From 423e36fc65bd0204d725b94223e08570cb7c266d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Mon, 18 Mar 2019 20:14:00 +0100 Subject: [PATCH] Fix precision issue with real and as the crow flies length. --- src/main/org/insa/graph/io/BinaryGraphReader.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/org/insa/graph/io/BinaryGraphReader.java b/src/main/org/insa/graph/io/BinaryGraphReader.java index ba33d25..c132a40 100644 --- a/src/main/org/insa/graph/io/BinaryGraphReader.java +++ b/src/main/org/insa/graph/io/BinaryGraphReader.java @@ -249,6 +249,9 @@ public class BinaryGraphReader extends BinaryReader implements GraphReader { } maxLength = Math.max(length, maxLength); + length = Math.max(length, (float) Point.distance(nodes.get(node).getPoint(), + nodes.get(destNode).getPoint())); + // Number of segments. int nbSegments = dis.readUnsignedShort();