Introduction to Geospatial Queries in MongoDB

Introduction to Geospatial Queries in MongoDB

Hans Kristian Flaatten

December 15, 2015

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

14 slides
  1. 1 ! Geometriske Spøringer Hans Kristian Flaatten @Starefossen Bergen MongoDB

    & NoSQL User Group Tirsdag 15. desember 2015 Bergen og Hordaland Turlag
  2. Geometriske indexer • Sfærisk (Spherical) • index: 2dsphere • data:

    GeoJSON • Flat (legacy) • index: 2d • data: coordinate pairs 2
  3. 2dsphere • Introdusert i MongoDB v2.4.0 • http://geojson.org/ • coordinate-axis

    order: longitude, latitude • coordinate reference system: WGS84 datum 3
  4. GeoJSON • Point (v2.4.0) • LineString (v2.4.0) • Polygon (v2.4.0)

    • MultiPoint (v2.4.0) • MultiLineString (v2.6.0) • MultiPolygon (v2.6.0) • GeometryCollection (v2.6.0) 4
  5. GeoJSON 5 { "type": "LineString", "coordinates": [ [100.0, 0.0], [101.0,

    1.0], [102.0, 2.0] ], "properties": { "name": "Simple Line" } }
  6. Coordinate Reference System (CRS) • geoid • ellipsoid (spheroid) •

    Lokal: NAD1983, GDA94 • Global: WGS84, GRS80, International 1924 6
  7. $geoWithin (improved) 12 $geoWithin: { $box: [ [ <bottom left

    coordinates> ], [ <upper right coordinates> ] ] }
  8. $near 14 $near: { $geometry: { type: "Point", coordinates: coordinates:

    [<lon> , <lat>] }, $maxDistance: <distance in meters>, $minDistance: <distance in meters> }

More Decks by Hans Kristian Flaatten

Other Decks in Technology