Geospatial Index Tutorials¶
Instructions for creating and querying
- Find Restaurants with Geospatial Queries
- Use Geospatial queries to find a user’s current neighborhood and list nearby restaurants.
- Create a 2dsphere Index
2dsphereindex supports data stored as both GeoJSON objects and as legacy coordinate pairs.
- Query a 2dsphere Index
- Search for locations within, near, or intersected by a GeoJSON shape, or within a circle as defined by coordinate points on a sphere.
- Create a 2d Index
- Create a
2dindex to support queries on data stored as legacy coordinate pairs.
- Query a 2d Index
- Search for locations using legacy coordinate pairs.
- Create a Haystack Index
- A haystack index is optimized to return results over small areas.
For queries that use spherical geometry, a
2dsphereindex is a better option.
- Query a Haystack Index
- Search based on location and non-location data within a small area.
- Calculate Distance Using Spherical Geometry
- Convert distances to radians and back again.