SlideShare a Scribd company logo
Building Spatial Web Services
     with MongoDB + NodeJS in
        Less than 30 Minutes
      Steven Citron-Pousty
      PaaS Dust Spreader, Red Hat
      @TheSteve0


1
Agenda
    •Learn a little spatial
    •Load some spatial data into mongo
    •Do a query or two
    •Repo for today’s code is here –
    •https://github.com/openshift/openshift-mongo-node-
    express-example

             SIGN UP CODE:
              mongoboulder
2
Assumptions
    1)You already know that Node.JS + Mongo is like
    chocolate and peanut butter
    2)You can use the command line
    3)You are comfortable with Mongo command line
    4)Please ask questions – though since we only have 30
    minutes they may have to wait until the end or after the
    session




3
Kind of like Amazon, right? Nope.




4
Cook24v on Flickr
5
What’s supported?




6
There’s more? What’s the catch?
•OpenShift is free-as-in-beer & free-as-in-freedom
•Three 512 MB RAM / 1 GB storage gears
•Need more resources, just ask!
•We are really in Developer Preview




7
On to spatial!




8
Spatial is fun
    The spatial functionality Mongo currently has is:
    1)Near
    2)Containment
    All of it is laid out on two pages:
    http://docs.mongodb.org/manual/applications/geospatial-
    indexes/

    And

    http://docs.mongodb.org/manual/core/geospatial-
    indexes/
9
Good to know
 1.Assumes coords. 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 ] }
 {   loc   :   {   x : 50 , y : 30 } }
 {   loc   :   {   foo : 50 , y : 30 } }
 {   loc   :   {   lon : 40.739037, lat: 73.992964 } }

 If you use spherical make sure to put [lon, lat]

 2) Make a 2d index
      db.places.ensureIndex( { loc : "2d" } )

 There is also a Haystack index – buckets the world




11
Demo
 1.I have a Node.JS app and a mongo instance running,
 with spatial data and 2D index already created
 2.Do some fun spatial and MongoDB work
 3.Show you the web services




12
Conclusion
 1.Spatial is easy and fun on Mongo
 2.You can now build your own Foursquare or other
 checkin 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.
                  SIGN UP CODE:
                   mongoboulder


         http://openshift.redhat.com
13
Ad

Recommended

PDF
MongoSF - Spatial MongoDB in OpenShift - script file
Steven Pousty
 
PDF
Script for the geomeetup presentation
Steven Pousty
 
PPT
Mongo sf spatialmongo
Steven Pousty
 
PPTX
Spatial mongo for PHP and Zend
Steven Pousty
 
PPTX
Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012
Steven Pousty
 
PPT
Openshift GeoSpatial Capabilities
Steven Pousty
 
PPTX
OpenShift with Eclipse Tooling - EclipseCon 2012
Steven Pousty
 
PPTX
Free Mongo on OpenShift
Steven Pousty
 
PDF
Spatial script for my JS.Everywhere 2012
Steven Pousty
 
PPTX
Bringing Spatial Love to Your Java Application
MongoDB
 
PPTX
Back to Basics German 3: Einführung in Replica Sets
MongoDB
 
PDF
Restinio - header-only http and websocket server
corehard_by
 
PDF
Redis clustering
Ravi Yasas
 
PDF
Ruby on embedded devices rug::b Aug 2014
Eno Thierbach
 
PPTX
Python Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron Rothman
Ron Rothman
 
PDF
GCE NFS HA
Simon Su
 
PDF
Cloud Firestore – From JSON Deserialization to Object Document Mapping (ODM)
Minh Dao
 
PDF
Build, Ship, and Run Any App, Anywhere using Docker
Rahulkrishnan R A
 
PDF
Node36
beshoy semsem
 
PDF
faastCrystal
Sachirou Inoue
 
PDF
Introduction to Hadoop - FinistJug
David Morin
 
PDF
今日から始めるPlan 9 from Bell Labs
Ryousei Takano
 
PPTX
Highload осень 2012 лекция 8
Technopark
 
PPTX
nodester Architecture overview & roadmap
wearefractal
 
PPTX
Nodester Architecture overview & roadmap
cmatthieu
 
PDF
Mashup your life with Yahoo Pipes
Cristiano Betta
 
PPTX
Geek Sync | Using PowerShell with Python and SQL Server
IDERA Software
 
PDF
BOSH deploys distributed systems, and Diego runs any containers
Benjamin Gandon
 
ODT
Spatial script for MongoBoulder
Steven Pousty
 
PDF
Introduction to PaaS for application developers
Steven Pousty
 

More Related Content

What's hot (20)

PDF
Spatial script for my JS.Everywhere 2012
Steven Pousty
 
PPTX
Bringing Spatial Love to Your Java Application
MongoDB
 
PPTX
Back to Basics German 3: Einführung in Replica Sets
MongoDB
 
PDF
Restinio - header-only http and websocket server
corehard_by
 
PDF
Redis clustering
Ravi Yasas
 
PDF
Ruby on embedded devices rug::b Aug 2014
Eno Thierbach
 
PPTX
Python Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron Rothman
Ron Rothman
 
PDF
GCE NFS HA
Simon Su
 
PDF
Cloud Firestore – From JSON Deserialization to Object Document Mapping (ODM)
Minh Dao
 
PDF
Build, Ship, and Run Any App, Anywhere using Docker
Rahulkrishnan R A
 
PDF
Node36
beshoy semsem
 
PDF
faastCrystal
Sachirou Inoue
 
PDF
Introduction to Hadoop - FinistJug
David Morin
 
PDF
今日から始めるPlan 9 from Bell Labs
Ryousei Takano
 
PPTX
Highload осень 2012 лекция 8
Technopark
 
PPTX
nodester Architecture overview & roadmap
wearefractal
 
PPTX
Nodester Architecture overview & roadmap
cmatthieu
 
PDF
Mashup your life with Yahoo Pipes
Cristiano Betta
 
PPTX
Geek Sync | Using PowerShell with Python and SQL Server
IDERA Software
 
PDF
BOSH deploys distributed systems, and Diego runs any containers
Benjamin Gandon
 
Spatial script for my JS.Everywhere 2012
Steven Pousty
 
Bringing Spatial Love to Your Java Application
MongoDB
 
Back to Basics German 3: Einführung in Replica Sets
MongoDB
 
Restinio - header-only http and websocket server
corehard_by
 
Redis clustering
Ravi Yasas
 
Ruby on embedded devices rug::b Aug 2014
Eno Thierbach
 
Python Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron Rothman
Ron Rothman
 
GCE NFS HA
Simon Su
 
Cloud Firestore – From JSON Deserialization to Object Document Mapping (ODM)
Minh Dao
 
Build, Ship, and Run Any App, Anywhere using Docker
Rahulkrishnan R A
 
faastCrystal
Sachirou Inoue
 
Introduction to Hadoop - FinistJug
David Morin
 
今日から始めるPlan 9 from Bell Labs
Ryousei Takano
 
Highload осень 2012 лекция 8
Technopark
 
nodester Architecture overview & roadmap
wearefractal
 
Nodester Architecture overview & roadmap
cmatthieu
 
Mashup your life with Yahoo Pipes
Cristiano Betta
 
Geek Sync | Using PowerShell with Python and SQL Server
IDERA Software
 
BOSH deploys distributed systems, and Diego runs any containers
Benjamin Gandon
 

Viewers also liked (19)

ODT
Spatial script for MongoBoulder
Steven Pousty
 
PDF
Introduction to PaaS for application developers
Steven Pousty
 
PDF
London Cloud Summit 2014 - raising the tide: getting developers in the cloud
Steven Pousty
 
PPTX
APPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + Docker
Steven Pousty
 
PPT
Workshop For pycon13
Steven Pousty
 
PDF
Spatial script for CIMA
Steven Pousty
 
PDF
Open shift intro for Philly PUG
Steven Pousty
 
PPTX
Monkigras - dropping science on your developer ecosystem
Steven Pousty
 
ODP
Build a PaaS with OpenShift Origin
Steven Pousty
 
PDF
Express: the web server for node.js
Eugene Lazutkin
 
PDF
Node.js and express
JoaquimSerafim
 
PPTX
Ultimate Node.js countdown: the coolest Application Express examples
Alan Arentsen
 
PDF
Node.js with express
javakidxxx
 
PDF
Node.js with Express
Gergely Németh
 
PDF
Introduction to Node.JS Express
Eueung Mulyana
 
PPTX
Node.js Express
Eyal Vardi
 
PPTX
The SEAN stack - Build Web Apps With Salesforce, Express, Angular and Node.js
Shashank Srivatsavaya (ShashForce)
 
PDF
Create Restful Web Application With Node.js Express Framework
Edureka!
 
PPTX
Node.js and express
Sunny Sharma
 
Spatial script for MongoBoulder
Steven Pousty
 
Introduction to PaaS for application developers
Steven Pousty
 
London Cloud Summit 2014 - raising the tide: getting developers in the cloud
Steven Pousty
 
APPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + Docker
Steven Pousty
 
Workshop For pycon13
Steven Pousty
 
Spatial script for CIMA
Steven Pousty
 
Open shift intro for Philly PUG
Steven Pousty
 
Monkigras - dropping science on your developer ecosystem
Steven Pousty
 
Build a PaaS with OpenShift Origin
Steven Pousty
 
Express: the web server for node.js
Eugene Lazutkin
 
Node.js and express
JoaquimSerafim
 
Ultimate Node.js countdown: the coolest Application Express examples
Alan Arentsen
 
Node.js with express
javakidxxx
 
Node.js with Express
Gergely Németh
 
Introduction to Node.JS Express
Eueung Mulyana
 
Node.js Express
Eyal Vardi
 
The SEAN stack - Build Web Apps With Salesforce, Express, Angular and Node.js
Shashank Srivatsavaya (ShashForce)
 
Create Restful Web Application With Node.js Express Framework
Edureka!
 
Node.js and express
Sunny Sharma
 
Ad

Similar to Spatial MongoDB, Node.JS, and Express - server-side JS for your application (20)

PDF
Mongo db bangalore
MongoDB
 
PDF
Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Ma...
OpenShift Origin
 
PDF
Bringing spatial love to your python application
Shekhar Gulati
 
PDF
Silicon Valley Code Camp 2014 - Advanced MongoDB
Daniel Coupal
 
PDF
Philadelphia MongoDB User Group - Your First MongoDB Application
Michael Lynn
 
PDF
Building Social IRC Bots with Node.js and MongoDB
MongoDB
 
PPT
MongoDB Pros and Cons
johnrjenson
 
PDF
New paradigms
Borja A. Espejo García
 
PPTX
Geoindexing with MongoDB
leafnode
 
PDF
How to use MongoDB with CakePHP
ichikaway
 
KEY
MongoDB on CloudFoundry
Yohei Sasaki
 
KEY
MongoDB on CloudFoundry
Yohei Sasaki
 
PDF
Java(ee) mongo db applications in the cloud
Shekhar Gulati
 
PDF
Mongo db first steps with csharp
Serdar Buyuktemiz
 
PPTX
Back to Basics Spanish 4 Introduction to sharding
MongoDB
 
PDF
Introduction to using MongoDB with Ruby
Jonathan Holloway
 
PDF
Scaling with mongo db (with notes)
emiltamas
 
PDF
Accra MongoDB User Group
MongoDB
 
PDF
MongoDB and the MEAN Stack
MongoDB
 
PDF
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB
 
Mongo db bangalore
MongoDB
 
Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Ma...
OpenShift Origin
 
Bringing spatial love to your python application
Shekhar Gulati
 
Silicon Valley Code Camp 2014 - Advanced MongoDB
Daniel Coupal
 
Philadelphia MongoDB User Group - Your First MongoDB Application
Michael Lynn
 
Building Social IRC Bots with Node.js and MongoDB
MongoDB
 
MongoDB Pros and Cons
johnrjenson
 
Geoindexing with MongoDB
leafnode
 
How to use MongoDB with CakePHP
ichikaway
 
MongoDB on CloudFoundry
Yohei Sasaki
 
MongoDB on CloudFoundry
Yohei Sasaki
 
Java(ee) mongo db applications in the cloud
Shekhar Gulati
 
Mongo db first steps with csharp
Serdar Buyuktemiz
 
Back to Basics Spanish 4 Introduction to sharding
MongoDB
 
Introduction to using MongoDB with Ruby
Jonathan Holloway
 
Scaling with mongo db (with notes)
emiltamas
 
Accra MongoDB User Group
MongoDB
 
MongoDB and the MEAN Stack
MongoDB
 
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB
 
Ad

More from Steven Pousty (7)

PDF
Spatial script for Spatial mongo for PHP and Zend
Steven Pousty
 
PPTX
Dropping Science on Your Developer Ecosystem - lessons from Ecosystem Management
Steven Pousty
 
PPT
Open shift intro for Philly PUG
Steven Pousty
 
PDF
Script for Spatial Mongo
Steven Pousty
 
PPTX
deCarta at BAPI
Steven Pousty
 
PPT
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your App
Steven Pousty
 
PPT
Using PostGIS To Add Some Spatial Flavor To Your Application
Steven Pousty
 
Spatial script for Spatial mongo for PHP and Zend
Steven Pousty
 
Dropping Science on Your Developer Ecosystem - lessons from Ecosystem Management
Steven Pousty
 
Open shift intro for Philly PUG
Steven Pousty
 
Script for Spatial Mongo
Steven Pousty
 
deCarta at BAPI
Steven Pousty
 
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your App
Steven Pousty
 
Using PostGIS To Add Some Spatial Flavor To Your Application
Steven Pousty
 

Recently uploaded (20)

PDF
The Growing Value and Application of FME & GenAI
Safe Software
 
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PDF
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
All Things Open
 
PDF
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
PDF
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
PDF
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
PPTX
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
PPTX
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
PDF
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
PDF
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
PDF
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
 
PDF
Quantum AI: Where Impossible Becomes Probable
Saikat Basu
 
PDF
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
PDF
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
PPTX
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
PDF
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
PDF
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
PDF
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
PDF
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
PDF
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
The Growing Value and Application of FME & GenAI
Safe Software
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
All Things Open
 
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
 
Quantum AI: Where Impossible Becomes Probable
Saikat Basu
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 

Spatial MongoDB, Node.JS, and Express - server-side JS for your application

  • 1. Building Spatial Web Services with MongoDB + NodeJS in Less than 30 Minutes Steven Citron-Pousty PaaS Dust Spreader, Red Hat @TheSteve0 1
  • 2. Agenda •Learn a little spatial •Load some spatial data into mongo •Do a query or two •Repo for today’s code is here – •https://github.com/openshift/openshift-mongo-node- express-example SIGN UP CODE: mongoboulder 2
  • 3. Assumptions 1)You already know that Node.JS + Mongo is like chocolate and peanut butter 2)You can use the command line 3)You are comfortable with Mongo command line 4)Please ask questions – though since we only have 30 minutes they may have to wait until the end or after the session 3
  • 4. Kind of like Amazon, right? Nope. 4
  • 7. There’s more? What’s the catch? •OpenShift is free-as-in-beer & free-as-in-freedom •Three 512 MB RAM / 1 GB storage gears •Need more resources, just ask! •We are really in Developer Preview 7
  • 9. Spatial is fun The spatial functionality Mongo currently has is: 1)Near 2)Containment All of it is laid out on two pages: http://docs.mongodb.org/manual/applications/geospatial- indexes/ And http://docs.mongodb.org/manual/core/geospatial- indexes/ 9
  • 10. Good to know 1.Assumes coords. 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 ] } { loc : { x : 50 , y : 30 } } { loc : { foo : 50 , y : 30 } } { loc : { lon : 40.739037, lat: 73.992964 } } If you use spherical make sure to put [lon, lat] 2) Make a 2d index db.places.ensureIndex( { loc : "2d" } ) There is also a Haystack index – buckets the world 11
  • 12. Demo 1.I have a Node.JS app and a mongo instance running, with spatial data and 2D index already created 2.Do some fun spatial and MongoDB work 3.Show you the web services 12
  • 13. Conclusion 1.Spatial is easy and fun on Mongo 2.You can now build your own Foursquare or other checkin 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. SIGN UP CODE: mongoboulder http://openshift.redhat.com 13