Spatial Mongo Intro at Open Cloud Conf.
Upcoming SlideShare
Loading in...5
×
 

Spatial Mongo Intro at Open Cloud Conf.

on

  • 884 views

An introduction to Spatial Mongo I gave at Open Cloud Conf. Look for the PDF that contains the SQL I used during the talk.

An introduction to Spatial Mongo I gave at Open Cloud Conf. Look for the PDF that contains the SQL I used during the talk.

Statistics

Views

Total Views
884
Views on SlideShare
883
Embed Views
1

Actions

Likes
1
Downloads
7
Comments
0

1 Embed 1

https://twitter.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Spatial Mongo Intro at Open Cloud Conf. Spatial Mongo Intro at Open Cloud Conf. Presentation Transcript

  • Get your Spatial on with MongoDB in the Cloud Steven Citron-Pousty PaaS Dust Spreader, Red Hat1
  • Agenda • Learn a little spatial • Load some spatial data into MongoDB • Do a query or two • Show some server-side code using it2
  • Assumptions 1) You can use the command line 2) You are comfortable with MongoDB command line 3) Please ask questions3
  • What is OpenShift? Red Hats free, auto-scaling Platform as a Service (PaaS) for applications in the cloud.4
  • Kind of like Amazon, right? Nope.5
  • What’s supported?6
  • Looks great, but what’s the catch?• OpenShift is free-as-in-beer & free-as-in-freedom• Three 1.5 GB RAM / 3 GB storage gears• Need more resources, just ask!7
  • On to Spatial and MongoDB8
  • Spatial is fun! The only spatial functionality MongoDB currently has is: 2) Near 3) Containment All of it is laid out on one page: http://www.mongodb.org/display/DOCS/Geospatial+Indexing First link on a google search for “MongoDB spatial indexing”9
  • Caveats 1. Assumes coordinates are between -180 and 180 2. Can handle any 2d coordinates 3. Has methods to handle curvature of the earth (spherical)10
  • How to make it work 1) Put your coordinates into an arrary { loc : [ 50 , 30 ] } //SUGGESTED OPTION { loc : { x : 50 , y : 30 } } { loc : { foo : 50 , y : 30 } } { loc : { lon : 40.739037, lat: 73.992964 } } 6) Make a 2d index db.places.ensureIndex( { loc : "2d" } )11
  • Demo 1. I have an app and a MongoDB instance running 2. Load some spatial data in JSON format 3. Make the 2d index 4. Do a bunch of command you would need in building an app (except Deleting docs, because that is easy cheezy)12
  • Conclusion 1. Spatial is easy and fun on MongoDB! 2. You can now build your own FourSquare or other check-in application. 3. You can also build your own field data entry system. 4. You can build and deploy your application quickly without having to think about infrastructure.13