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
Temporal 最高!でも改めて「日付」について調べたら人類の負債すぎる件
riyaamemiya
0
150
自作バイナリを動かす「入口」8選
puhitaku
2
1.3k
触りたくないデータに、どう触るか AI時代のRBACアクセスガバナンス
ivry_presentationmaterials
0
260
分析の民主化を支えるメタデータ整備の実践
kakehashi
PRO
4
1.4k
Refining Active Record
shugo
0
160
Classmethod Company Deck
satoshi7
1
690
ソフトウェア ファクトリー - 再現性のあるソフトウェアの工場づくり / Software factory
iktakahiro
6
4.9k
Rustuna: Rustによる高速なOptuna実装
pfn
PRO
0
190
「Docker Desktop不要の時代」は 来たのか?
ueponx
0
770
二歩目のフロントエンド・ウェブアクセシビリティ
camiha
2
620
DevelopersIO 2026 知識の地図を描く ─ オントロジーとは何か?
ishikawa_satoru
1
1.7k
フロントエンドカンファレンス関西2026 - 速すぎるUIに、待ち時間を
teamlab
PRO
0
130
Featured
See All Featured
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
870
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
730
Git: the NoSQL Database
bkeepers
PRO
433
67k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
550
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
640
Six Lessons from altMBA
skipperchong
29
4.5k
Between Models and Reality
mayunak
4
500
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
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> }