From 0d06344869a5260ac51058243f4c5c0fe1276c83 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 8 Mar 2021 16:15:19 +0100 Subject: [PATCH] Formatting --- .../main/java/net/osmand/osm/edit/OsmMapUtils.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/osm/edit/OsmMapUtils.java b/OsmAnd-java/src/main/java/net/osmand/osm/edit/OsmMapUtils.java index 5e19d09658..cf86ca88ed 100644 --- a/OsmAnd-java/src/main/java/net/osmand/osm/edit/OsmMapUtils.java +++ b/OsmAnd-java/src/main/java/net/osmand/osm/edit/OsmMapUtils.java @@ -153,35 +153,34 @@ public class OsmMapUtils { } boolean area = w.getFirstNodeId() == w.getLastNodeId(); // double check for area (could be negative all) - if(area) { + if (area) { Node fn = w.getFirstNode(); Node ln = w.getLastNode(); - if(fn != null && fn != null && MapUtils.getDistance(fn.getLatLon(), ln.getLatLon()) < 50) { + if (fn != null && fn != null && MapUtils.getDistance(fn.getLatLon(), ln.getLatLon()) < 50) { area = true; } else { area = false; } } LatLon ll = area ? getComplexPolyCenter(nodes, null) : getWeightCenterForNodes(nodes); - if(ll == null) { + if (ll == null) { return null; } double flat = ll.getLatitude(); double flon = ll.getLongitude(); - if(!area || !MapAlgorithms.containsPoint(nodes, ll.getLatitude(), ll.getLongitude())) { + if (!area || !MapAlgorithms.containsPoint(nodes, ll.getLatitude(), ll.getLongitude())) { double minDistance = Double.MAX_VALUE; for (Node n : nodes) { if (n != null) { double d = MapUtils.getDistance(n.getLatitude(), n.getLongitude(), ll.getLatitude(), ll.getLongitude()); - if(d < minDistance) { + if (d < minDistance) { flat = n.getLatitude(); flon = n.getLongitude(); minDistance = d; } } - } + } } - return new LatLon(flat, flon); }