Merge pull request #9282 from osmandapp/9221_fix
simplify center calc for 4-point polygons #9221
This commit is contained in:
commit
9661cd2dd5
1 changed files with 6 additions and 0 deletions
|
@ -87,6 +87,12 @@ public class OsmMapUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static LatLon getComplexPolyCenter(Collection<Node> outer, List<List<Node>> inner) {
|
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<>();
|
final List<List<LatLon>> rings = new ArrayList<>();
|
||||||
List<LatLon> outerRing = new ArrayList<>();
|
List<LatLon> outerRing = new ArrayList<>();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue