simplify center calc for 4-point polygons
This commit is contained in:
parent
f2866dadbe
commit
c1f5534c32
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