SlideShare une entreprise Scribd logo
1  sur  13
Get your Spatial on with
    MongoDB in the Cloud

     Steven Citron-Pousty
     PaaS Dust Spreader, Red Hat




1
Agenda
    • Learn a little spatial
    • Load some spatial data into MongoDB
    • Do a query or two
    • Show some server-side code using it
    • MAKE YOU A ROCKSTAR!!




2
Assumptions
    1) You can use the command line
    2) You are comfortable with MongoDB command line
    3) Please ask questions – though since we only have 30
       minutes they may have to wait until the end or after
       the session




3
What is OpenShift?

     Red Hat's 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!
• We are in Developer Preview




7
On to Spatial and MongoDB




8
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

Contenu connexe

Tendances

Mongo db bangalore
Mongo db bangaloreMongo db bangalore
Mongo db bangalore
MongoDB
 
Workshop For pycon13
Workshop For pycon13Workshop For pycon13
Workshop For pycon13
Steven Pousty
 
Confessions of a relational addict
Confessions of a relational addictConfessions of a relational addict
Confessions of a relational addict
Chandra Patni
 
How to rewrite the OS using C by strong type
How to rewrite the OS using C by strong typeHow to rewrite the OS using C by strong type
How to rewrite the OS using C by strong type
Kiwamu Okabe
 
Блохин Леонид - "Mist, как часть Hydrosphere"
Блохин Леонид - "Mist, как часть Hydrosphere"Блохин Леонид - "Mist, как часть Hydrosphere"
Блохин Леонид - "Mist, как часть Hydrosphere"
Provectus
 
nodester Architecture overview & roadmap
nodester Architecture overview & roadmapnodester Architecture overview & roadmap
nodester Architecture overview & roadmap
wearefractal
 

Tendances (20)

AGES Presentation on Web, Python, Django and GeoServer
AGES Presentation on Web, Python, Django and GeoServerAGES Presentation on Web, Python, Django and GeoServer
AGES Presentation on Web, Python, Django and GeoServer
 
Mongo db bangalore
Mongo db bangaloreMongo db bangalore
Mongo db bangalore
 
Workshop For pycon13
Workshop For pycon13Workshop For pycon13
Workshop For pycon13
 
Back to Basics German 3: Einführung in Replica Sets
Back to Basics German 3: Einführung in Replica SetsBack to Basics German 3: Einführung in Replica Sets
Back to Basics German 3: Einführung in Replica Sets
 
My Learnings on Setting up a Kubernetes Cluster on AWS using Kubernetes Opera...
My Learnings on Setting up a Kubernetes Cluster on AWS using Kubernetes Opera...My Learnings on Setting up a Kubernetes Cluster on AWS using Kubernetes Opera...
My Learnings on Setting up a Kubernetes Cluster on AWS using Kubernetes Opera...
 
Restinio - header-only http and websocket server
Restinio - header-only http and websocket serverRestinio - header-only http and websocket server
Restinio - header-only http and websocket server
 
GPFS - graphical intro
GPFS - graphical introGPFS - graphical intro
GPFS - graphical intro
 
Run C++ as serverless with GCP Cloud Functions
Run C++ as serverless with GCP Cloud FunctionsRun C++ as serverless with GCP Cloud Functions
Run C++ as serverless with GCP Cloud Functions
 
Cloud Firestore – From JSON Deserialization to Object Document Mapping (ODM)
Cloud Firestore – From JSON Deserialization to Object Document Mapping (ODM)Cloud Firestore – From JSON Deserialization to Object Document Mapping (ODM)
Cloud Firestore – From JSON Deserialization to Object Document Mapping (ODM)
 
Confessions of a relational addict
Confessions of a relational addictConfessions of a relational addict
Confessions of a relational addict
 
Docker and stuff
Docker and stuffDocker and stuff
Docker and stuff
 
Dockerizing Rails
Dockerizing RailsDockerizing Rails
Dockerizing Rails
 
Bringing spatial love to your python application
Bringing spatial love to your python applicationBringing spatial love to your python application
Bringing spatial love to your python application
 
Reverse on go
Reverse on goReverse on go
Reverse on go
 
How to rewrite the OS using C by strong type
How to rewrite the OS using C by strong typeHow to rewrite the OS using C by strong type
How to rewrite the OS using C by strong type
 
FaaS you like it (if Shakespeare had written Functions-as-a-Service)
FaaS you like it (if Shakespeare had written Functions-as-a-Service)FaaS you like it (if Shakespeare had written Functions-as-a-Service)
FaaS you like it (if Shakespeare had written Functions-as-a-Service)
 
Блохин Леонид - "Mist, как часть Hydrosphere"
Блохин Леонид - "Mist, как часть Hydrosphere"Блохин Леонид - "Mist, как часть Hydrosphere"
Блохин Леонид - "Mist, как часть Hydrosphere"
 
Collaboration With Git and GitHub
Collaboration With Git and GitHubCollaboration With Git and GitHub
Collaboration With Git and GitHub
 
Decision making - for loop , nested loop ,if-else statements , switch in goph...
Decision making - for loop , nested loop ,if-else statements , switch in goph...Decision making - for loop , nested loop ,if-else statements , switch in goph...
Decision making - for loop , nested loop ,if-else statements , switch in goph...
 
nodester Architecture overview & roadmap
nodester Architecture overview & roadmapnodester Architecture overview & roadmap
nodester Architecture overview & roadmap
 

Similaire à Mongo sf spatialmongo

Bringing Spatial Love to Your Java Application
Bringing Spatial Love to Your Java ApplicationBringing Spatial Love to Your Java Application
Bringing Spatial Love to Your Java Application
MongoDB
 
Mongo db first steps with csharp
Mongo db first steps with csharpMongo db first steps with csharp
Mongo db first steps with csharp
Serdar Buyuktemiz
 
MongoDB Knowledge Shareing
MongoDB Knowledge ShareingMongoDB Knowledge Shareing
MongoDB Knowledge Shareing
Philip Zhong
 

Similaire à Mongo sf spatialmongo (20)

Bringing Spatial Love to Your Java Application
Bringing Spatial Love to Your Java ApplicationBringing Spatial Love to Your Java Application
Bringing Spatial Love to Your Java Application
 
Using MongoDB For BigData in 20 Minutes
Using MongoDB For BigData in 20 MinutesUsing MongoDB For BigData in 20 Minutes
Using MongoDB For BigData in 20 Minutes
 
Bringing Some Spatial Love to your Application with OpenShift - Mongo Berlin ...
Bringing Some Spatial Love to your Application with OpenShift - Mongo Berlin ...Bringing Some Spatial Love to your Application with OpenShift - Mongo Berlin ...
Bringing Some Spatial Love to your Application with OpenShift - Mongo Berlin ...
 
Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Ma...
Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Ma...Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Ma...
Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Ma...
 
Mongo db first steps with csharp
Mongo db first steps with csharpMongo db first steps with csharp
Mongo db first steps with csharp
 
MongoDB Knowledge Shareing
MongoDB Knowledge ShareingMongoDB Knowledge Shareing
MongoDB Knowledge Shareing
 
Building Social IRC Bots with Node.js and MongoDB
Building Social IRC Bots with Node.js and MongoDBBuilding Social IRC Bots with Node.js and MongoDB
Building Social IRC Bots with Node.js and MongoDB
 
Philadelphia MongoDB User Group - Your First MongoDB Application
Philadelphia MongoDB User Group - Your First MongoDB ApplicationPhiladelphia MongoDB User Group - Your First MongoDB Application
Philadelphia MongoDB User Group - Your First MongoDB Application
 
MongoDB on CloudFoundry
MongoDB on CloudFoundryMongoDB on CloudFoundry
MongoDB on CloudFoundry
 
MongoDB on CloudFoundry
MongoDB on CloudFoundryMongoDB on CloudFoundry
MongoDB on CloudFoundry
 
MongoDB 2.4 and spring data
MongoDB 2.4 and spring dataMongoDB 2.4 and spring data
MongoDB 2.4 and spring data
 
New paradigms
New paradigmsNew paradigms
New paradigms
 
Back to Basics Spanish 4 Introduction to sharding
Back to Basics Spanish 4 Introduction to shardingBack to Basics Spanish 4 Introduction to sharding
Back to Basics Spanish 4 Introduction to sharding
 
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDBMongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
 
Scaling with mongo db (with notes)
Scaling with mongo db (with notes)Scaling with mongo db (with notes)
Scaling with mongo db (with notes)
 
Geoindexing with MongoDB
Geoindexing with MongoDBGeoindexing with MongoDB
Geoindexing with MongoDB
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
 
MongoDB Pros and Cons
MongoDB Pros and ConsMongoDB Pros and Cons
MongoDB Pros and Cons
 
MongoDB Days Silicon Valley: Jumpstart: Ops/Admin 101
MongoDB Days Silicon Valley: Jumpstart: Ops/Admin 101MongoDB Days Silicon Valley: Jumpstart: Ops/Admin 101
MongoDB Days Silicon Valley: Jumpstart: Ops/Admin 101
 
Ops Jumpstart: Admin 101
Ops Jumpstart: Admin 101Ops Jumpstart: Admin 101
Ops Jumpstart: Admin 101
 

Plus de Steven Pousty

APPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + Docker
APPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + DockerAPPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + Docker
APPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + Docker
Steven Pousty
 
Spatial script for CIMA
Spatial script for CIMASpatial script for CIMA
Spatial script for CIMA
Steven Pousty
 
Spatial script for my JS.Everywhere 2012
Spatial script for my JS.Everywhere 2012Spatial script for my JS.Everywhere 2012
Spatial script for my JS.Everywhere 2012
Steven Pousty
 
Spatial script for Spatial mongo for PHP and Zend
Spatial script for Spatial mongo for PHP and ZendSpatial script for Spatial mongo for PHP and Zend
Spatial script for Spatial mongo for PHP and Zend
Steven Pousty
 
Dropping Science on Your Developer Ecosystem - lessons from Ecosystem Management
Dropping Science on Your Developer Ecosystem - lessons from Ecosystem ManagementDropping Science on Your Developer Ecosystem - lessons from Ecosystem Management
Dropping Science on Your Developer Ecosystem - lessons from Ecosystem Management
Steven Pousty
 
Using PostGIS To Add Some Spatial Flavor To Your Application
Using PostGIS To Add Some Spatial Flavor To Your ApplicationUsing PostGIS To Add Some Spatial Flavor To Your Application
Using PostGIS To Add Some Spatial Flavor To Your Application
Steven Pousty
 

Plus de Steven Pousty (16)

APPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + Docker
APPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + DockerAPPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + Docker
APPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + Docker
 
Introduction to PaaS for application developers
Introduction to PaaS for application developersIntroduction to PaaS for application developers
Introduction to PaaS for application developers
 
London Cloud Summit 2014 - raising the tide: getting developers in the cloud
London Cloud Summit 2014  - raising the tide: getting developers in the cloudLondon Cloud Summit 2014  - raising the tide: getting developers in the cloud
London Cloud Summit 2014 - raising the tide: getting developers in the cloud
 
Build a PaaS with OpenShift Origin
Build a PaaS with OpenShift OriginBuild a PaaS with OpenShift Origin
Build a PaaS with OpenShift Origin
 
Monkigras - dropping science on your developer ecosystem
Monkigras - dropping science on your developer ecosystemMonkigras - dropping science on your developer ecosystem
Monkigras - dropping science on your developer ecosystem
 
Spatial script for MongoBoulder
Spatial script for MongoBoulderSpatial script for MongoBoulder
Spatial script for MongoBoulder
 
Spatial script for CIMA
Spatial script for CIMASpatial script for CIMA
Spatial script for CIMA
 
Spatial script for my JS.Everywhere 2012
Spatial script for my JS.Everywhere 2012Spatial script for my JS.Everywhere 2012
Spatial script for my JS.Everywhere 2012
 
Spatial script for Spatial mongo for PHP and Zend
Spatial script for Spatial mongo for PHP and ZendSpatial script for Spatial mongo for PHP and Zend
Spatial script for Spatial mongo for PHP and Zend
 
Dropping Science on Your Developer Ecosystem - lessons from Ecosystem Management
Dropping Science on Your Developer Ecosystem - lessons from Ecosystem ManagementDropping Science on Your Developer Ecosystem - lessons from Ecosystem Management
Dropping Science on Your Developer Ecosystem - lessons from Ecosystem Management
 
Open shift intro for Philly PUG
Open shift intro for Philly PUGOpen shift intro for Philly PUG
Open shift intro for Philly PUG
 
Open shift intro for Philly PUG
Open shift intro for Philly PUGOpen shift intro for Philly PUG
Open shift intro for Philly PUG
 
Script for Spatial Mongo
Script for Spatial MongoScript for Spatial Mongo
Script for Spatial Mongo
 
deCarta at BAPI
deCarta at BAPI deCarta at BAPI
deCarta at BAPI
 
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your App
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your AppLinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your App
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your App
 
Using PostGIS To Add Some Spatial Flavor To Your Application
Using PostGIS To Add Some Spatial Flavor To Your ApplicationUsing PostGIS To Add Some Spatial Flavor To Your Application
Using PostGIS To Add Some Spatial Flavor To Your Application
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Mongo sf spatialmongo

  • 1. Get your Spatial on with MongoDB in the Cloud Steven Citron-Pousty PaaS Dust Spreader, Red Hat 1
  • 2. Agenda • Learn a little spatial • Load some spatial data into MongoDB • Do a query or two • Show some server-side code using it • MAKE YOU A ROCKSTAR!! 2
  • 3. Assumptions 1) You can use the command line 2) You are comfortable with MongoDB command line 3) Please ask questions – though since we only have 30 minutes they may have to wait until the end or after the session 3
  • 4. What is OpenShift? Red Hat's free, auto-scaling Platform as a Service (PaaS) for applications in the cloud. 4
  • 5. Kind of like Amazon, right? Nope. 5
  • 7. 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! • We are in Developer Preview 7
  • 8. On to Spatial and MongoDB 8
  • 9. 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
  • 10. 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
  • 11. 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
  • 12. 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
  • 13. 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

Notes de l'éditeur

  1. ----- Meeting Notes (5/4/12 13:02) ----- Questions at the mic Comment cards and the green card at the back Cheers for Katie & 10gen for running a great