SlideShare a Scribd company logo
1   #commands for adding spatial data!
 2   !
 3   #Take a look at the file first!
 4   #less parkcoord.json!
 5   !
 6   #get the file on the server!
 7   scp parkcoord.json 30bb1262b1364026855e358a649f171b@parks-spmongo.rhcloud.com:app-root/data!
 8   !
 9   #ssh into the machine!
10   ssh 30bb1262b1364026855e358a649f171b@parks-spmongo.rhcloud.com!
11   !
12   !
13   #import into mongo!
14   mongoimport -d parks -c parkpoints --type json --file app-root/data/parkcoord.json -h
 …   $OPENSHIFT_NOSQL_DB_HOST -u admin -p $OPENSHIFT_NOSQL_DB_PASSWORD!
15   !
16   #open the mongo shell!
17   mongo !
18   !
19   #build the index!
20   db.parkpoints.ensureIndex({"pos":"2d"});!
21   !
22   #Now some queries!
23   #simple spatial!
24   db.parkpoints.find({"pos" : { "$near" : [-37, 41]}});!
25   !
26   #spatial and text query using regex!
27   db.parkpoints.find( { Name : /lincoln/i, pos : { $near : [-37,41] }} );!
28   !
29   #geonear TODO!
30   db.runCommand({ geoNear : "parkpoints", near : [-37,41], num : 10 });!
31   !
32   !
33   https://github.com/openshift/openshift-mongo-node-express-example!
34   !
35   http://nodewsos-spdemo.rhcloud.com/ws/parks!
36   !
37   !
38   !
39   !
40   !
41   !
42   #create a new collection from scratch!
43   db.createCollection("checkin");!
44   db.checkin.ensureIndex( { "pos" : "2d" } );!
45   !
46   #insert a new record!
47   db.checkin.insert({ "created" : new Date(), "Notes" : 'just landed', "pos" : [-76.7302 , 25.5332 ] })!
48   !   !
49   #quick query to make sure it worked!
50   db.checkin.find( { pos : { $near : [-37,41] } } )!
51   !
52   #add a second document closer to query point!
53   #this is an upsert - since we don't pass in the _id it creates a new record!
54   db.checkin.save({ created : new Date(), Notes: 'that was a big step', pos : [-37.7302 , 40.5332 ]});!
55   !
56   #one way to update original document!
57   myDoc = db.checkin.findOne({_id : ObjectId("50130d8ea8f6532e83026bc1")});!
58   myDoc.Notes = "really the landing";!
59   db.checkin.save(myDoc);!
60   !
61   !
62   !
63   !
64

More Related Content

What's hot (20)

PPTX
Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012
Steven Pousty
 
PPT
Mongo sf spatialmongo
Steven Pousty
 
PPTX
Spatial mongo for PHP and Zend
Steven Pousty
 
PPTX
CouchDB Day NYC 2017: Replication
IBM Cloud Data Services
 
PPTX
Python Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron Rothman
Ron Rothman
 
PPTX
CouchDB Day NYC 2017: Full Text Search
IBM Cloud Data Services
 
PDF
Biicode OpenExpoDay
fcofdezc
 
PPTX
OpenShift with Eclipse Tooling - EclipseCon 2012
Steven Pousty
 
PPTX
CouchDB Day NYC 2017: Introduction to CouchDB 2.0
IBM Cloud Data Services
 
KEY
gunicorn introduction
Adam Lowry
 
PPTX
MySQL Slow Query log Monitoring using Beats & ELK
YoungHeon (Roy) Kim
 
PDF
Rust vs. Go: qual è il linguaggio più adatto al tuo progetto?
Claudio Capobianco
 
PPT
Python And GIS - Beyond Modelbuilder And Pythonwin
Chad Cooper
 
PDF
Tests unitaires pour PostgreSQL avec pgTap
Rodolphe Quiédeville
 
PPT
Qtp Scripts
G.C Reddy
 
PPTX
CouchDB Day NYC 2017: MapReduce Views
IBM Cloud Data Services
 
PDF
Building a DSL with GraalVM (VoxxedDays Luxembourg)
Maarten Mulders
 
PDF
Logstash: Get to know your logs
SmartLogic
 
PPTX
Intro to R and H2O with Spencer Aiello
Sri Ambati
 
PPTX
CouchDB Day NYC 2017: JSON Documents
IBM Cloud Data Services
 
Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012
Steven Pousty
 
Mongo sf spatialmongo
Steven Pousty
 
Spatial mongo for PHP and Zend
Steven Pousty
 
CouchDB Day NYC 2017: Replication
IBM Cloud Data Services
 
Python Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron Rothman
Ron Rothman
 
CouchDB Day NYC 2017: Full Text Search
IBM Cloud Data Services
 
Biicode OpenExpoDay
fcofdezc
 
OpenShift with Eclipse Tooling - EclipseCon 2012
Steven Pousty
 
CouchDB Day NYC 2017: Introduction to CouchDB 2.0
IBM Cloud Data Services
 
gunicorn introduction
Adam Lowry
 
MySQL Slow Query log Monitoring using Beats & ELK
YoungHeon (Roy) Kim
 
Rust vs. Go: qual è il linguaggio più adatto al tuo progetto?
Claudio Capobianco
 
Python And GIS - Beyond Modelbuilder And Pythonwin
Chad Cooper
 
Tests unitaires pour PostgreSQL avec pgTap
Rodolphe Quiédeville
 
Qtp Scripts
G.C Reddy
 
CouchDB Day NYC 2017: MapReduce Views
IBM Cloud Data Services
 
Building a DSL with GraalVM (VoxxedDays Luxembourg)
Maarten Mulders
 
Logstash: Get to know your logs
SmartLogic
 
Intro to R and H2O with Spencer Aiello
Sri Ambati
 
CouchDB Day NYC 2017: JSON Documents
IBM Cloud Data Services
 

Viewers also liked (7)

PPT
Workshop For pycon13
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
 
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
 
Workshop For pycon13
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
 
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
 
Ad

Similar to Spatial script for CIMA (20)

PDF
MongoDB全機能解説2
Takahiro Inoue
 
PDF
Mongo db bangalore
MongoDB
 
PPTX
Getting Started with Geospatial Data in MongoDB
MongoDB
 
PPTX
Open Source Mapping with Python, and MongoDB
techprane
 
PPTX
Bringing Spatial Love to Your Java Application
MongoDB
 
KEY
Building Your First MongoDB Application
Rick Copeland
 
PDF
Bringing spatial love to your python application
Shekhar Gulati
 
PPTX
MongoDB GeoSpatial Feature
Hüseyin BABAL
 
PPT
MongoDB at the Silicon Valley iPhone and iPad Developers' Meetup
MongoDB
 
PPT
Building web applications with mongo db presentation
Murat Çakal
 
PDF
Thinking beyond RDBMS - Building Polyglot Persistence Java Applications Devf...
Shekhar Gulati
 
PPT
Building a web application with mongo db
MongoDB
 
PPT
Building Your First MongoDB Application (Mongo Austin)
MongoDB
 
PDF
はじめてのMongoDB
Takahiro Inoue
 
PPTX
Webinar: General Technical Overview of MongoDB for Dev Teams
MongoDB
 
PPT
Building Applications with MongoDB - an Introduction
MongoDB
 
PPTX
Webinar: Building Your First Application with MongoDB
MongoDB
 
PPT
Nosh slides mongodb web application - mongo philly 2011
MongoDB
 
PPT
Introduction to MongoDB
Nosh Petigara
 
PPT
9b. Document-Oriented Databases lab
Fabio Fumarola
 
MongoDB全機能解説2
Takahiro Inoue
 
Mongo db bangalore
MongoDB
 
Getting Started with Geospatial Data in MongoDB
MongoDB
 
Open Source Mapping with Python, and MongoDB
techprane
 
Bringing Spatial Love to Your Java Application
MongoDB
 
Building Your First MongoDB Application
Rick Copeland
 
Bringing spatial love to your python application
Shekhar Gulati
 
MongoDB GeoSpatial Feature
Hüseyin BABAL
 
MongoDB at the Silicon Valley iPhone and iPad Developers' Meetup
MongoDB
 
Building web applications with mongo db presentation
Murat Çakal
 
Thinking beyond RDBMS - Building Polyglot Persistence Java Applications Devf...
Shekhar Gulati
 
Building a web application with mongo db
MongoDB
 
Building Your First MongoDB Application (Mongo Austin)
MongoDB
 
はじめてのMongoDB
Takahiro Inoue
 
Webinar: General Technical Overview of MongoDB for Dev Teams
MongoDB
 
Building Applications with MongoDB - an Introduction
MongoDB
 
Webinar: Building Your First Application with MongoDB
MongoDB
 
Nosh slides mongodb web application - mongo philly 2011
MongoDB
 
Introduction to MongoDB
Nosh Petigara
 
9b. Document-Oriented Databases lab
Fabio Fumarola
 
Ad

More from Steven Pousty (6)

PPTX
Dropping Science on Your Developer Ecosystem - lessons from Ecosystem Management
Steven Pousty
 
PPT
Open shift intro for Philly PUG
Steven Pousty
 
PPTX
Free Mongo on OpenShift
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
 
Dropping Science on Your Developer Ecosystem - lessons from Ecosystem Management
Steven Pousty
 
Open shift intro for Philly PUG
Steven Pousty
 
Free Mongo on OpenShift
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)

PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 

Spatial script for CIMA

  • 1. 1 #commands for adding spatial data! 2 ! 3 #Take a look at the file first! 4 #less parkcoord.json! 5 ! 6 #get the file on the server! 7 scp parkcoord.json [email protected]:app-root/data! 8 ! 9 #ssh into the machine! 10 ssh [email protected]! 11 ! 12 ! 13 #import into mongo! 14 mongoimport -d parks -c parkpoints --type json --file app-root/data/parkcoord.json -h … $OPENSHIFT_NOSQL_DB_HOST -u admin -p $OPENSHIFT_NOSQL_DB_PASSWORD! 15 ! 16 #open the mongo shell! 17 mongo ! 18 ! 19 #build the index! 20 db.parkpoints.ensureIndex({"pos":"2d"});! 21 ! 22 #Now some queries! 23 #simple spatial! 24 db.parkpoints.find({"pos" : { "$near" : [-37, 41]}});! 25 ! 26 #spatial and text query using regex! 27 db.parkpoints.find( { Name : /lincoln/i, pos : { $near : [-37,41] }} );! 28 ! 29 #geonear TODO! 30 db.runCommand({ geoNear : "parkpoints", near : [-37,41], num : 10 });! 31 ! 32 ! 33 https://github.com/openshift/openshift-mongo-node-express-example! 34 ! 35 http://nodewsos-spdemo.rhcloud.com/ws/parks! 36 ! 37 ! 38 ! 39 ! 40 ! 41 ! 42 #create a new collection from scratch! 43 db.createCollection("checkin");! 44 db.checkin.ensureIndex( { "pos" : "2d" } );! 45 ! 46 #insert a new record! 47 db.checkin.insert({ "created" : new Date(), "Notes" : 'just landed', "pos" : [-76.7302 , 25.5332 ] })! 48 ! ! 49 #quick query to make sure it worked! 50 db.checkin.find( { pos : { $near : [-37,41] } } )! 51 ! 52 #add a second document closer to query point! 53 #this is an upsert - since we don't pass in the _id it creates a new record! 54 db.checkin.save({ created : new Date(), Notes: 'that was a big step', pos : [-37.7302 , 40.5332 ]});! 55 ! 56 #one way to update original document! 57 myDoc = db.checkin.findOne({_id : ObjectId("50130d8ea8f6532e83026bc1")});! 58 myDoc.Notes = "really the landing";! 59 db.checkin.save(myDoc);! 60 ! 61 ! 62 ! 63 ! 64