Skip to content

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: