def polygon_requires_clipping(wgs84_polygon):
geom_type = wgs84_polygon.geom_type
if geom_type == 'MultiPolygon':
polygons = wgs84_polygon.coords
elif geom_type == 'Polygon':
polygons = [wgs84_polygon.coords]
else:
raise Exception("Unknown geom_type {0}".format(geom_type))
for polygon in polygons:
for t in polygon:
for x, y in t:
point = Point(x, y)
if not uk_multipolygon.contains(point):
return True
return False
# ------------------------------------------------------------------------
# Make sure the output directory exists:
评论列表
文章目录