I'm having trouble while trying to create polygon using the shapely library in python.
[testPolygon(polygonShape) for polygonShape in fileAppender]
and the testPolygon function is defined as:
def testPolygon(polygonShape):
if shapely.wkt.loads(polygonShape).is_valid:
print("great")
but I'm having this error:
IllegalArgumentException: Invalid number of points in LinearRing found 3 - must be 0 or >= 4
Is there anyway to check if the string object (polygonShape) is a valid polygon before parse it? Or even better, if it's possible to correct this corrupt polygon?