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
28
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
34
Continuous Integrations with Jenkins
starefossen
0
48
Testing Node.js
starefossen
0
22
What is Node.js?
starefossen
0
31
LeftPad Not Found
starefossen
0
76
Whats New In EcmaScript 2015 / ES6
starefossen
0
57
Experience with NoSQL at the Norwegian Trekking Asocciation
starefossen
0
27
Åpen Tur- og Friluftsdata
starefossen
0
81
Reverse Engineering APIs from iOS and Android Apps
starefossen
0
55
Other Decks in Technology
See All in Technology
AWSに詳しくない人でも始められるコスト最適化ガイド
yuhta28
2
270
2024春 注目のWeb系 OSS & SaaS 3選
makies
0
170
Babylon.jsと色々なものを組み合わせる:ブラウザのAPIやガジェットや2D描画ライブラリなど / Babylon.js 勉強会 vol.3
you
PRO
0
140
Handling focus in 2024
tahia910
0
120
開発パフォーマンスを最大化するための開発体制
ham0215
2
510
Azure Container Apps + Bicep 〜 こんな感じで運用しています
kaz29
3
610
JAWS-UG Bedrock Claude Night
yamahiro
3
680
Building Dashboards as a Hobby
egmc
0
340
[新卒向け研修資料] テスト文字列に「うんこ」と入れるな(2024年版)
infiniteloop_inc
4
17k
家族アルバム みてねにおけるGrafana活用術 / Grafana Meetup Japan Vol.1 LT
isaoshimizu
1
890
よく聞くけど使ったことないソフトウェアNo.1 KafkaとSnowflake
foursue
4
390
Azureの基本的な権限管理の勉強会
yhana
1
1.8k
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
244
12k
Become a Pro
speakerdeck
PRO
12
4.6k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
63
14k
Testing 201, or: Great Expectations
jmmastey
29
6.4k
We Have a Design System, Now What?
morganepeng
44
6.8k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
188
16k
What’s in a name? Adding method to the madness
productmarketing
PRO
17
2.7k
Fontdeck: Realign not Redesign
paulrobertlloyd
76
4.9k
Code Review Best Practice
trishagee
56
15k
Embracing the Ebb and Flow
colly
80
4.2k
How GitHub (no longer) Works
holman
305
140k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
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> }