Querylight TS Demo

Geo Indexing with Points and Polygons

Store GeoJSON and query by point containment or polygon intersection.

Back to docs search

Reference Entry

Geo Indexing with Points and Polygons

Other Features · advanced · order 40

Store GeoJSON and query by point containment or polygon intersection.

Geo Indexing with Points and Polygons

GeoFieldIndex stores GeoJSON and indexes it by geohash.

Point query

import { GeoPointQuery } from "@tryformation/querylight-ts";

const query = new GeoPointQuery("location", 52.52, 13.405);

Polygon query

import { GeoPolygonQuery, rectangleToPolygon } from "@tryformation/querylight-ts";

const query = new GeoPolygonQuery(
  "location",
  rectangleToPolygon(-10, 48, 25, 61)
);

The demo maps documentation topics to example points so the geo API can be explored from the same browser.

Learn more