GeoData
#
GeoDataGeoData
is a service to help developers to manipulate and handle geospatial data properly. Whenever you want to save geospatial data and query operations (nearest location) on it, GeoData
is the right way to do it. All methods are accessible in publicData
, userData
and App Data, but you will need to pay attention to pass the Geospatial Data in the right structure.
#
Inserting Geolocation DataThis is the most important part, because the rest will follow like any other type of data. So when you insert the geospatial data you need to put it like the below JSON structure:
Available GeoJSON types :
Point
MultiPoint
LineString
MultiLineString
Polygon
MultiPolygon
GeometryCollection
important
Please note that we will save whatever data you provide, even if it didn't follow the above JSON structure. This might break the GEO functionality, thus it won't work as expected.
#
Insert Example#
Search ExampleThe following query uses the $near
geospatial query operator to return documents that are at least 1000 meters from and at most 5000 meters from the specified GeoJSON
point, sorted in order from nearest to farthest:
important
Please note that Polygon has to close (the first and last point must be the same).
Available Geospatial query operators:
$near
: Returns geospatial objects in proximity to a point.$geoWithin
: Selects geometries within a bounding GeoJSON geometry.$geoIntersects
: Selects geometries that intersect with a GeoJSON geometry$nearSphere
: Returns geospatial objects in proximity to a point on a sphere.