org.apache.lucene.spatial.geopoint.search

## Class GeoPointInPolygonQuery

- java.lang.Object
- - org.apache.lucene.search.Query
  - - org.apache.lucene.spatial.geopoint.search.GeoPointInBBoxQuery
    - - org.apache.lucene.spatial.geopoint.search.GeoPointInPolygonQuery

- Deprecated.
  Use the higher performance `LatLonPoint.newPolygonQuery` instead.

      @Deprecated
      public final class GeoPointInPolygonQuery
      extends GeoPointInBBoxQuery

  Implements a simple point in polygon query on a GeoPoint field. This is based on `GeoPointInBBoxQueryImpl` and is implemented using a three phase approach. First, like `GeoPointInBBoxQueryImpl` candidate terms are queried using a numeric range based on the morton codes of the min and max lat/lon pairs. Terms passing this initial filter are passed to a secondary filter that verifies whether the decoded lat/lon point falls within (or on the boundary) of the bounding box query. Finally, the remaining candidate term is passed to the final point in polygon check.
  See Also:
    `Polygon`
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.spatial.geopoint.search.GeoPointInBBoxQuery

      `field, maxLat, maxLon, minLat, minLon, termEncoding`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GeoPointInPolygonQuery(String field, double[] polyLats, double[] polyLons)` Deprecated. Use `GeoPointInPolygonQuery(String, Polygon[])`.
    `GeoPointInPolygonQuery(String field, GeoPointField.TermEncoding termEncoding, double[] polyLats, double[] polyLons)` Deprecated. Use `GeoPointInPolygonQuery(String, GeoPointField.TermEncoding, Polygon[])` instead.
    `GeoPointInPolygonQuery(String field, GeoPointField.TermEncoding termEncoding, Polygon... polygons)` Deprecated. Constructs a new GeoPolygonQuery that will match encoded `GeoPointField` terms that fall within or on the boundary of the polygons defined by the input parameters.
    `GeoPointInPolygonQuery(String field, Polygon... polygons)` Deprecated. Constructs a new GeoPolygonQuery that will match encoded `GeoPointField` terms that fall within or on the boundary of the polygons defined by the input parameters.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)` Deprecated.
    `Polygon[]` | `getPolygons()` Deprecated. API utility method for returning copy of the polygon array
    `int` | `hashCode()` Deprecated.
    `Query` | `rewrite(IndexReader reader)` Deprecated. throw exception if trying to change rewrite method
    `String` | `toString(String field)` Deprecated. print out this polygon query

    - ### Methods inherited from class org.apache.lucene.spatial.geopoint.search.GeoPointInBBoxQuery

      `getField, getMaxLat, getMaxLon, getMinLat, getMinLon`

    - ### Methods inherited from class org.apache.lucene.search.Query

      `classHash, createWeight, sameClassAs, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### GeoPointInPolygonQuery

          public GeoPointInPolygonQuery(String field,
                                        Polygon... polygons)

      Deprecated.
      Constructs a new GeoPolygonQuery that will match encoded `GeoPointField` terms that fall within or on the boundary of the polygons defined by the input parameters.

    - #### GeoPointInPolygonQuery

          @Deprecated
          public GeoPointInPolygonQuery(String field,
                                                    double[] polyLats,
                                                    double[] polyLons)

      Deprecated. Use `GeoPointInPolygonQuery(String, Polygon[])`.
      Constructs a new GeoPolygonQuery that will match encoded `GeoPointField` terms that fall within or on the boundary of the polygon defined by the input parameters.

    - #### GeoPointInPolygonQuery

          @Deprecated
          public GeoPointInPolygonQuery(String field,
                                                    GeoPointField.TermEncoding termEncoding,
                                                    double[] polyLats,
                                                    double[] polyLons)

      Deprecated. Use `GeoPointInPolygonQuery(String, GeoPointField.TermEncoding, Polygon[])` instead.
      Constructs a new GeoPolygonQuery that will match encoded `GeoPointField` terms that fall within or on the boundary of the polygon defined by the input parameters.

    - #### GeoPointInPolygonQuery

          public GeoPointInPolygonQuery(String field,
                                        GeoPointField.TermEncoding termEncoding,
                                        Polygon... polygons)

      Deprecated.
      Constructs a new GeoPolygonQuery that will match encoded `GeoPointField` terms that fall within or on the boundary of the polygons defined by the input parameters.

  - ### Method Detail

    - #### rewrite

          public Query rewrite(IndexReader reader)

      Deprecated.
      throw exception if trying to change rewrite method
      Overrides:
        `rewrite` in class `GeoPointInBBoxQuery`

    - #### hashCode

          public int hashCode()

      Deprecated.
      Overrides:
        `hashCode` in class `GeoPointInBBoxQuery`

    - #### equals

          public boolean equals(Object obj)

      Deprecated.
      Overrides:
        `equals` in class `GeoPointInBBoxQuery`

    - #### toString

          public String toString(String field)

      Deprecated.
      print out this polygon query
      Overrides:
        `toString` in class `GeoPointInBBoxQuery`

    - #### getPolygons

          public Polygon[] getPolygons()

      Deprecated.
      API utility method for returning copy of the polygon array

Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.