Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introduction to Geospatial Queries in MongoDB
Search
Hans Kristian Flaatten
December 15, 2015
Technology
0
30
Introduction to Geospatial Queries in MongoDB
Hans Kristian Flaatten
December 15, 2015
Tweet
Share
More Decks by Hans Kristian Flaatten
See All by Hans Kristian Flaatten
Continuous Deployment with Jenkins Pipelines
starefossen
0
52
Continuous Integrations with Jenkins
starefossen
0
64
Testing Node.js
starefossen
0
27
What is Node.js?
starefossen
0
39
LeftPad Not Found
starefossen
0
81
Whats New In EcmaScript 2015 / ES6
starefossen
0
67
Experience with NoSQL at the Norwegian Trekking Asocciation
starefossen
0
38
Åpen Tur- og Friluftsdata
starefossen
0
99
Reverse Engineering APIs from iOS and Android Apps
starefossen
0
63
Other Decks in Technology
See All in Technology
KubeCon + CloudNativeCon Japan 2025 Recap
ren510dev
1
340
Model Mondays S2E03: SLMs & Reasoning
nitya
0
280
低レイヤを知りたいPHPerのためのCコンパイラ作成入門 完全版 / Building a C Compiler for PHPers Who Want to Dive into Low-Level Programming - Expanded
tomzoh
4
3.4k
CI/CD/IaC 久々に0から環境を作ったらこうなりました
kaz29
1
210
OPENLOGI Company Profile
hr01
0
67k
事業成長の裏側:エンジニア組織と開発生産性の進化 / 20250703 Rinto Ikenoue
shift_evolve
PRO
2
11k
製造業からパッケージ製品まで、あらゆる領域をカバー!生成AIを利用したテストシナリオ生成 / 20250627 Suguru Ishii
shift_evolve
PRO
1
160
怖くない!はじめてのClaude Code
shinya337
0
320
Glacierだからってコストあきらめてない? / JAWS Meet Glacier Cost
taishin
1
110
MUITにおける開発プロセスモダナイズの取り組みと開発生産性可視化の取り組みについて / Modernize the Development Process and Visualize Development Productivity at MUIT
muit
1
8.1k
本が全く読めなかった過去の自分へ
genshun9
0
730
ハッカソン by 生成AIハッカソンvol.05
1ftseabass
PRO
0
160
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
5.9k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.9k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.5k
The Pragmatic Product Professional
lauravandoore
35
6.7k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
Unsuck your backbone
ammeep
671
58k
Transcript
1 ! Geometriske Spøringer Hans Kristian Flaatten @Starefossen Bergen MongoDB
& NoSQL User Group Tirsdag 15. desember 2015 Bergen og Hordaland Turlag
Geometriske indexer • Sfærisk (Spherical) • index: 2dsphere • data:
GeoJSON • Flat (legacy) • index: 2d • data: coordinate pairs 2
2dsphere • Introdusert i MongoDB v2.4.0 • http://geojson.org/ • coordinate-axis
order: longitude, latitude • coordinate reference system: WGS84 datum 3
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
GeoJSON 5 { "type": "LineString", "coordinates": [ [100.0, 0.0], [101.0,
1.0], [102.0, 2.0] ], "properties": { "name": "Simple Line" } }
Coordinate Reference System (CRS) • geoid • ellipsoid (spheroid) •
Lokal: NAD1983, GDA94 • Global: WGS84, GRS80, International 1924 6
7 geoid Ellipsoide globalt best passende til geoiden Ellipsoide regionalt
tilpasset geoiden Best mulig passform
topografi geosenter b a 8 H h
Geometriske Spøringer 9 $geoWithin <Polygon> $geoIntersects <*>
$near <Point>
2dsphere index 10 db.collection.createIndex({ <location field> : "2dsphere" });
$geoWithin 11 $geoWithin: { $geometry: { type: <"Polygon" or "MultiPolygon">,
coordinates: [ <coordinates> ] } }
$geoWithin (improved) 12 $geoWithin: { $box: [ [ <bottom left
coordinates> ], [ <upper right coordinates> ] ] }
$geoIntersects 13 $geoIntersects: { $geometry: { type: <"GeoJSON object type">,
coordinates: [ <coordinates> ] } }
$near 14 $near: { $geometry: { type: "Point", coordinates: coordinates:
[<lon> , <lat>] }, $maxDistance: <distance in meters>, $minDistance: <distance in meters> }