See MongoDB https://docs.mongodb.com/manual/reference/operator/query-geospatial/ for details of spatial queries. This functions generates only: geoIntersects, geoWithin, near or nearSphere.

gc_query(query, type, coords, ...)

Arguments

query

MongoDB query type which must be one of geoIntersects, geoWithin, near or nearSphere.

type

geom type which must be a valid GeoJSON type

coords

list of coordinates which matches type Or just provide a valid sf with one row as both type and coords.

...

different params.

Value

JSON valid MongoDB query