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
32
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
54
Continuous Integrations with Jenkins
starefossen
0
65
Testing Node.js
starefossen
0
29
What is Node.js?
starefossen
0
40
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
39
Åpen Tur- og Friluftsdata
starefossen
0
100
Reverse Engineering APIs from iOS and Android Apps
starefossen
0
64
Other Decks in Technology
See All in Technology
能登半島災害現場エンジニアクロストーク 【JAWS FESTA 2025 in 金沢】
ditccsugii
0
820
能登半島地震で見えた災害対応の課題と組織変革の重要性
ditccsugii
0
930
AgentCon Accra: Ctrl + Alt + Assist: AI Agents Edition
bethany
0
110
やる気のない自分との向き合い方/How to Deal with Your Unmotivated Self
sanogemaru
0
500
エンタメとAIのための3Dパラレルワールド構築(GPU UNITE 2025 特別講演)
pfn
PRO
0
320
ユーザーの声とAI検証で進める、プロダクトディスカバリー
sansantech
PRO
1
140
カンファレンスに託児サポートがあるということ / Having Childcare Support at Conferences
nobu09
1
570
2025-10-09_プロジェクトマネージャーAIチャンス
taukami
0
140
セキュアな認可付きリモートMCPサーバーをAWSマネージドサービスでつくろう! / Let's build an OAuth protected remote MCP server based on AWS managed services
kaminashi
3
320
CoRL 2025 Survey
harukiabe
1
200
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
930
フレームワークを意識させないワークショップづくり
keigosuda
0
190
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
33
2.3k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
Building Applications with DynamoDB
mza
96
6.7k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
53k
Automating Front-end Workflow
addyosmani
1371
200k
Why Our Code Smells
bkeepers
PRO
340
57k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Docker and Python
trallard
46
3.6k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.7k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
4 Signs Your Business is Dying
shpigford
185
22k
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> }