Merge pull request #9282 from osmandapp/9221_fix

simplify center calc for 4-point polygons #9221
This commit is contained in:
vshcherb 2020-06-23 13:30:39 +02:00 committed by GitHub
commit 9661cd2dd5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -87,6 +87,12 @@ public class OsmMapUtils {
}
public static LatLon getComplexPolyCenter(Collection<Node> outer, List<List<Node>> inner) {
if (outer.size() <= 5 && inner == null) {
List<Node> sub = new ArrayList<>(outer);
return getWeightCenterForNodes(sub.subList(0, sub.size()-1));
}
final List<List<LatLon>> rings = new ArrayList<>();
List<LatLon> outerRing = new ArrayList<>();