S2Polygon.initializeToSnapped

Convenience function that snaps the vertices to S2CellId centers at the given level (default level 30, which has S2CellId centers spaced about 1 centimeter apart). Polygons can be efficiently encoded by Encode() after they have been snapped.

  1. void initializeToSnapped(S2Polygon a, S2Builder.SnapFunction snap_function)
  2. void initializeToSnapped(S2Polygon a, int snap_level)
    class S2Polygon
    void
    initializeToSnapped

Meta