S2ClosestPointQueryTarget represents the geometry to which the distance is measured. There are subtypes for measuring the distance to a point, an edge, an S2Cell, or an S2ShapeIndex (an arbitrary collection of geometry).
Given a set of points stored in an S2PointIndex, S2ClosestPointQuery provides methods that find the closest point(s) to a given query point or query edge. Example usage:
Target subtype that computes the closest distance to an S2Cell (including the interior of the cell).
Target subtype that computes the closest distance to an edge.
Options that control the set of points returned. Note that by default *all* points are returned, so you will always want to set either the max_points() option or the max_distance() option (or both).
Target subtype that computes the closest distance to a point.
Target subtype that computes the closest distance to an S2ShapeIndex (an arbitrary collection of points, polylines, and/or polygons).