Support polygon simplification
Arkindex does not support polygons with more than 166 points.
If a polygon has more than 160 points, it should be simplified using the shapely's simplify method, using a regresion towards tolerance:
for tolerance in range(1, 20):
simplified = simplify(polygon, tolerance)
if len(simplified) <= 160:
return simplified
raise Exception("No simplification possible using normal tolerances")
See https://gitlab.com/arkindex/requests/-/issues/207 for details on corpus to test:
- failing process with errors : https://arkindex.teklia.com/process/76204143-7de0-41e7-8c56-92cc67ce8514/0
- image that should have more items: https://arkindex.teklia.com/element/a4083570-b105-4cff-b9eb-e9e1646b1745