Skip to main content
Version: 0.13.0

Geographic and xy queries

Geographic and xy queries let you search fields that contain points and shapes on a map or coordinate plane. Geographic queries work on geospatial data, while xy queries work on two-dimensional coordinate data. Out of all geographic queries, the geoshape query is very similar to the xy query, but the former searches geographic fields, while the latter searches Cartesian fields.

xy queries​

xy queries search for documents that contain geometries in a Cartesian coordinate system. These geometries can be specified in xy_point fields, which support points, and xy_shape fields, which support points, lines, circles, and polygons.

xy queries return documents whose xy shapes relate to the provided shape. The default relation is intersects. See Geoshape query for the full list of relations, which the cartesian shape / xy_shape query shares. xy points support intersects.

Geographic queries​

Geographic queries search for documents that contain geospatial geometries. These geometries can be specified in geo_point fields, which support points on a map, and geo_shape fields, which support points, lines, circles, and polygons.

Lucenia provides the following geographic query types:

  • Geo-bounding box queries: Return documents with geopoint field values that are within a bounding box.
  • Geodistance queries return documents with geopoints that are within a specified distance from the provided geopoint.
  • Geopolygon queries return documents with geopoints that are within a polygon.
  • Geoshape queries: Return documents whose geoshapes or geopoints relate to a provided shape. Relations include intersects, covers, st_contains, st_touches, and the rest of the set documented on that page.