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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
86
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
Kubernetesにおける推論基盤
ry
1
400
Scrumは歪む — 組織設計の原理原則
dashi
0
190
オレ達はAWS管理をやりたいんじゃない!開発の生産性を爆アゲしたいんだ!!
wkm2
4
540
[JAWSDAYS2026][D8]その起票、愛が足りてますか?AWSサポートを味方につける、技術的「ラブレター」の書き方
hirosys_
3
190
Go標準パッケージのI/O処理をながめる
matumoto
0
220
(Test) ai-meetup slide creation
oikon48
3
410
AI駆動AI普及活動 ~ 社内AI活用の「何から始めれば?」をAIで突破する
oracle4engineer
PRO
1
110
クラウド × シリコンの Mashup - AWS チップ開発で広がる AI 基盤の選択肢
htokoyo
2
260
OCI技術資料 : コンピュート・サービス 概要
ocise
4
54k
会社紹介資料 / Sansan Company Profile
sansan33
PRO
16
410k
[E2]CCoEはAI指揮官へ。Bedrock×MCPで構築するコスト・セキュリティ自律運用基盤
taku1418
0
170
PMとしての意思決定とAI活用状況について
lycorptech_jp
PRO
0
130
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
For a Future-Friendly Web
brad_frost
183
10k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.7k
Balancing Empowerment & Direction
lara
5
940
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
120
A Tale of Four Properties
chriscoyier
163
24k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
220
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
390
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
The Spectacular Lies of Maps
axbom
PRO
1
620
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
240
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
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> }