Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Introduction to Geospatial Queries in MongoDB
Search
Hans Kristian Flaatten
December 15, 2015
Technology
43
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Introduction to Geospatial Queries in MongoDB
Hans Kristian Flaatten
December 15, 2015
More Decks by Hans Kristian Flaatten
See All by Hans Kristian Flaatten
Continuous Deployment with Jenkins Pipelines
starefossen
0
65
Continuous Integrations with Jenkins
starefossen
0
74
Testing Node.js
starefossen
0
36
What is Node.js?
starefossen
0
48
LeftPad Not Found
starefossen
0
92
Whats New In EcmaScript 2015 / ES6
starefossen
0
79
Experience with NoSQL at the Norwegian Trekking Asocciation
starefossen
0
57
Åpen Tur- og Friluftsdata
starefossen
0
110
Reverse Engineering APIs from iOS and Android Apps
starefossen
0
72
Other Decks in Technology
See All in Technology
OptunaHub: ブラックボックス最適化のためのプラットフォーム
pfn
PRO
0
140
re:Invent初参加で変わったこと、2回目にやってみたいこと(JAWS-UG彩の国埼玉 #12)
mhrtech
2
230
Temporal 最高!でも改めて「日付」について調べたら人類の負債すぎる件
riyaamemiya
0
150
WasmをRustにする
sansantech
PRO
0
250
その Valkey 使いこなしていますか?
onk
PRO
5
1.5k
Persisting Massive Data with Rails ~Designing for 60 billion rows, and fighting the bottlenecks~ Railsで挑む大量データ永続化 〜600億件を永続化するための設計とボトルネックとの戦い〜
occhi
0
730
PagerDuty Tech Hub-鳴らすけれど、人は動かない
ezaki
0
170
USB PDを使ってスマホを労わりたい
raspython3
0
180
大型犬好きによるPugの紹介
yamanoku
1
160
How to Design Configuration for Rails Applications
willnet
1
800
しろおびから始める!ログ活用の第一歩
shumei_ito
0
950
夫婦で子育てするための育児標準化
codmoninc
PRO
0
350
Featured
See All Featured
The untapped power of vector embeddings
frankvandijk
2
1.9k
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
Crafting Experiences
bethany
1
380
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
Mind Mapping
helmedeiros
1
400
[SF Ruby Conf 2025] Rails X
palkan
3
1.5k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
The SEO Collaboration Effect
kristinabergwall1
1
590
The SEO identity crisis: Don't let AI make you average
varn
0
590
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
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> }