Class S2ContainsPointQuery


  • @GwtCompatible
    public class S2ContainsPointQuery
    extends java.lang.Object
    A query for whether one or more shapes in an S2ShapeIndex contain a given S2Point.

    The S2ShapeIndex may contain any number of points, polylines, and/or polygons (possibly overlapping). Shape boundaries are modeled with a constructor parameter, S2ContainsPointQuery.S2VertexModel, which defaults to S2ContainsPointQuery.S2VertexModel.SEMI_OPEN. This may be customized to control whether or not shapes are considered to contain their vertices.

    This class is not thread-safe. To use it in parallel, each thread should construct its own instance (this is not expensive). However, note that if you need to do a large number of point containment tests, it is more efficient to re-use the S2ContainsPointQuery object rather than constructing a new one each time.