[osm] trying representative_point() on the unfixed polygons to capture some cases where the geometry still needs to be fixed before it's valid
This commit is contained in:
@@ -169,7 +169,9 @@ class PolygonIndex(object):
|
|||||||
|
|
||||||
poly = Polygon(coords, holes)
|
poly = Polygon(coords, holes)
|
||||||
try:
|
try:
|
||||||
invalid = cls.fix_invalid_polygons and not poly.is_valid and not poly.contains(poly.centroid)
|
if test_point is None:
|
||||||
|
test_point = poly.representative_point()
|
||||||
|
invalid = cls.fix_invalid_polygons and not poly.is_valid and not poly.contains(test_point)
|
||||||
except Exception:
|
except Exception:
|
||||||
invalid = True
|
invalid = True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user