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
33
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
55
Continuous Integrations with Jenkins
starefossen
0
67
Testing Node.js
starefossen
0
30
What is Node.js?
starefossen
0
41
LeftPad Not Found
starefossen
0
85
Whats New In EcmaScript 2015 / ES6
starefossen
0
70
Experience with NoSQL at the Norwegian Trekking Asocciation
starefossen
0
41
Åpen Tur- og Friluftsdata
starefossen
0
110
Reverse Engineering APIs from iOS and Android Apps
starefossen
0
64
Other Decks in Technology
See All in Technology
小さく始めるBCP ― 多プロダクト環境で始める最初の一歩
kekke_n
1
460
日本の85%が使う公共SaaSは、どう育ったのか
taketakekaho
1
230
SRE Enabling戦記 - 急成長する組織にSREを浸透させる戦いの歴史
markie1009
0
130
モダンUIでフルサーバーレスなAIエージェントをAmplifyとCDKでサクッとデプロイしよう
minorun365
4
220
超初心者からでも大丈夫!オープンソース半導体の楽しみ方〜今こそ!オレオレチップをつくろう〜
keropiyo
0
110
Digitization部 紹介資料
sansan33
PRO
1
6.8k
What happened to RubyGems and what can we learn?
mikemcquaid
0
310
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
480
Amazon Bedrock Knowledge Basesチャンキング解説!
aoinoguchi
0
160
量子クラウドサービスの裏側 〜Deep Dive into OQTOPUS〜
oqtopus
0
140
Webhook best practices for rock solid and resilient deployments
glaforge
2
300
15 years with Rails and DDD (AI Edition)
andrzejkrzywda
0
200
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
100
Color Theory Basics | Prateek | Gurzu
gurzu
0
200
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.2k
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
250
Accessibility Awareness
sabderemane
0
54
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
69
The Curse of the Amulet
leimatthew05
1
8.7k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
270
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
330
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> }