diff --git a/DataExtractionOSM/src/net/osmand/data/Ring.java b/DataExtractionOSM/src/net/osmand/data/Ring.java index d6ac790ee6..4ef1d2e1fd 100644 --- a/DataExtractionOSM/src/net/osmand/data/Ring.java +++ b/DataExtractionOSM/src/net/osmand/data/Ring.java @@ -30,6 +30,11 @@ public class Ring implements Comparable { */ private Way border; + /** + * area can be asked a lot of times when comparing rings, chace it + */ + private double area = -1; + /** @@ -349,7 +354,11 @@ public class Ring implements Comparable { } public double getArea() { - return MapAlgorithms.getArea(getBorder()); + if (area == -1) { + //cache the area + area = MapAlgorithms.getArea(getBorder()); + } + return area; }