Function S2Polygon.initializeToSimplified

Snaps the input polygon according to the given "snap_function" and reduces the number of vertices if possible, while ensuring that no vertex moves further than snap_function.snap_radius().

void initializeToSimplified (
  in const(S2Polygon) a,
  S2Builder.SnapFunction snap_function
);

Simplification works by replacing nearly straight chains of short edges with longer edges, in a way that preserves the topology of the input polygon up to the creation of degeneracies. This means that loops or portions of loops may become degenerate, in which case they are removed. For example, if there is a very small island in the original polygon, it may disappear completely. (Even if there are dense islands, they could all be removed rather than being replaced by a larger simplified island if more area is covered by water than land.)