Create index a GeoJSON object's feature and for a query based on a GeoJSON
object's feature. For creating an index only
Point feature is supported.
To cover simple, arbitrary areas the supported features are
This library uses S2, which means an index
for a more specific position is longer and has the same prefix as a position
that is bigger, but contains that area, so they are an ideal fit for database
indices. Also S2 creates tiles and with these tiles it can cover areas, but
these each tile has its own index, that's why the
cover method returns an
array of indices.
const geo =const foo =type: 'Feature'geometry:type: 'Point'coordinates: 340908829 -1183856206properties: bar: 'baz'consolegeo
$ npm i geojson-index
Object, that is a proper GeoJSON object or GeoJSON feature that can
be converted to one. Returns a
String that is the index for this feature.
dataObject: a proper GeoJSON object or GeoJSON feature that can be converted to one
radiusNumber: the radius in meters, which the indices should cover.
Promise or calls a
callback if specified with the result
Array of index pairs. A pair is an object with a
lt value, which
means the indices in that area are greater than or equal to
gte and lower
$ npm test