SlideShare ist ein Scribd-Unternehmen logo
1 von 1
Downloaden Sie, um offline zu lesen
1   #commands for adding spatial data!
 2   !
 3   #Take a look at the file first!
 4   less parkcoord.json!
 5   #get the file on the server!
 6   scp parkcoord.json 0b49d9219f2847c6a236820959f9a@parks-spmongo.rhcloud.com:parks/data/!
 7   !
 8   #ssh into the machine!
 9   ssh 0b49d9219f2847c6a236820959f9a@parks-spmongo.rhcloud.com!
10   !
11   #import into mongo!
12   mongoimport -d parks -c mongosf --type json --file parks/data/parkcoord.json -h $OPENSHIFT_NOSQL_DB_HOST -u admin -p <your
 …   password>!
13   !
14   #open the mongo shell!
15   mongo -u admin -p <your password> $OPENSHIFT_NOSQL_DB_HOST/parks!
16   !
17   #build the index!
18   db.mongosf.ensureIndex({"pos":"2d"});!
19   !
20   #Now some queries!
21   #simple spatial!
22   db.mongosf.find({"pos" : { "$near" : [-37, 41]}});!
23   !
24   #spatial and text query using regex!
25   db.mongosf.find( { Name : /lincoln/i, pos : { $near : [-37,41] }} );!
26   !
27   #geonear TODO!
28   db.runCommand({ geoNear : "mongosf", near : [-37,41], num : 10 });!
29   !
30   !
31   #create a new collection from scratch!
32   db.createCollection("mongosfuserloc");!
33   db.mongosfuserloc.ensureIndex( { pos : "2d" } );!
34   !
35   #insert a new record!
36   db.mongosfuserloc.insert({ "created" : new Date(), "Notes" : 'just landed', "pos" : [-76.7302 , 25.5332 ] })!
37   !   !
38   #quick query to make sure it worked!
39   db.mongosfuserloc.find( { pos : { $near : [-37,41] } } )!
40   !
41   #add a second document closer to query point!
42   #this is an upsert - since we don't pass in the _id it creates a new record!
43   db.mongosfuserloc.save({ created : new Date(), Notes: 'that was a big step', pos : [-37.7302 , 40.5332 ]});!
44   !
45   #one way to update original document!
46   myDoc = db.mongosfuserloc.findOne({_id : ObjectId("ID for the first object")});!
47   myDoc.Notes = "really the landing";!
48   db.mongosfuserloc.save(myDoc);!
49

Weitere ähnliche Inhalte

Was ist angesagt?

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 2012Steven Pousty
 
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 ApplicationMongoDB
 
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 SetsMongoDB
 
Introduction to Hadoop - FinistJug
Introduction to Hadoop - FinistJugIntroduction to Hadoop - FinistJug
Introduction to Hadoop - FinistJugDavid Morin
 
Installation of application server 10g in red hat 4
Installation of application server 10g in red hat 4Installation of application server 10g in red hat 4
Installation of application server 10g in red hat 4uzzzle
 
Ruby on embedded devices rug::b Aug 2014
Ruby on embedded devices rug::b Aug 2014Ruby on embedded devices rug::b Aug 2014
Ruby on embedded devices rug::b Aug 2014Eno Thierbach
 
Python Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron Rothman
Python Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron RothmanPython Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron Rothman
Python Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron RothmanRon Rothman
 
Redis clustering
Redis clusteringRedis clustering
Redis clusteringRavi Yasas
 
Infrastructure coders logstash
Infrastructure coders logstashInfrastructure coders logstash
Infrastructure coders logstashDavid Lutz
 
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)Minh Dao
 
Datafying Bitcoins
Datafying BitcoinsDatafying Bitcoins
Datafying BitcoinsTariq Ahmad
 
Make the prompt great again
Make the prompt great againMake the prompt great again
Make the prompt great againjtyr
 
Build, Ship, and Run Any App, Anywhere using Docker
Build, Ship, and Run Any App, Anywhere using Docker Build, Ship, and Run Any App, Anywhere using Docker
Build, Ship, and Run Any App, Anywhere using Docker Rahulkrishnan R A
 
MessagePack - An efficient binary serialization format
MessagePack - An efficient binary serialization formatMessagePack - An efficient binary serialization format
MessagePack - An efficient binary serialization formatLarry Nung
 
Hadoop con2016 - Implement Real-time Centralized logging System by Elastic Stack
Hadoop con2016 - Implement Real-time Centralized logging System by Elastic StackHadoop con2016 - Implement Real-time Centralized logging System by Elastic Stack
Hadoop con2016 - Implement Real-time Centralized logging System by Elastic StackLen Chang
 
How To Run Mapreduce Jobs In Python
How To Run Mapreduce Jobs In PythonHow To Run Mapreduce Jobs In Python
How To Run Mapreduce Jobs In PythonYi Wang
 
OSS AWS 핸즈온 강의
OSS AWS 핸즈온 강의OSS AWS 핸즈온 강의
OSS AWS 핸즈온 강의Juhong Jung
 
MongoDB 3.0.0 vs 2.6.x vs 2.4.x Benchmark
MongoDB 3.0.0 vs 2.6.x vs 2.4.x BenchmarkMongoDB 3.0.0 vs 2.6.x vs 2.4.x Benchmark
MongoDB 3.0.0 vs 2.6.x vs 2.4.x Benchmark承翰 蔡
 

Was ist angesagt? (20)

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
 
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
 
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
 
faastCrystal
faastCrystalfaastCrystal
faastCrystal
 
Introduction to Hadoop - FinistJug
Introduction to Hadoop - FinistJugIntroduction to Hadoop - FinistJug
Introduction to Hadoop - FinistJug
 
Installation of application server 10g in red hat 4
Installation of application server 10g in red hat 4Installation of application server 10g in red hat 4
Installation of application server 10g in red hat 4
 
Ruby on embedded devices rug::b Aug 2014
Ruby on embedded devices rug::b Aug 2014Ruby on embedded devices rug::b Aug 2014
Ruby on embedded devices rug::b Aug 2014
 
Python Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron Rothman
Python Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron RothmanPython Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron Rothman
Python Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron Rothman
 
Redis clustering
Redis clusteringRedis clustering
Redis clustering
 
Infrastructure coders logstash
Infrastructure coders logstashInfrastructure coders logstash
Infrastructure coders logstash
 
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)
 
Datafying Bitcoins
Datafying BitcoinsDatafying Bitcoins
Datafying Bitcoins
 
Make the prompt great again
Make the prompt great againMake the prompt great again
Make the prompt great again
 
Build, Ship, and Run Any App, Anywhere using Docker
Build, Ship, and Run Any App, Anywhere using Docker Build, Ship, and Run Any App, Anywhere using Docker
Build, Ship, and Run Any App, Anywhere using Docker
 
MessagePack - An efficient binary serialization format
MessagePack - An efficient binary serialization formatMessagePack - An efficient binary serialization format
MessagePack - An efficient binary serialization format
 
Kubernetes - Parte I
Kubernetes - Parte IKubernetes - Parte I
Kubernetes - Parte I
 
Hadoop con2016 - Implement Real-time Centralized logging System by Elastic Stack
Hadoop con2016 - Implement Real-time Centralized logging System by Elastic StackHadoop con2016 - Implement Real-time Centralized logging System by Elastic Stack
Hadoop con2016 - Implement Real-time Centralized logging System by Elastic Stack
 
How To Run Mapreduce Jobs In Python
How To Run Mapreduce Jobs In PythonHow To Run Mapreduce Jobs In Python
How To Run Mapreduce Jobs In Python
 
OSS AWS 핸즈온 강의
OSS AWS 핸즈온 강의OSS AWS 핸즈온 강의
OSS AWS 핸즈온 강의
 
MongoDB 3.0.0 vs 2.6.x vs 2.4.x Benchmark
MongoDB 3.0.0 vs 2.6.x vs 2.4.x BenchmarkMongoDB 3.0.0 vs 2.6.x vs 2.4.x Benchmark
MongoDB 3.0.0 vs 2.6.x vs 2.4.x Benchmark
 

Andere mochten auch

Overview Study on PIC32MX3XX / 4XX 32-Bit Controller
Overview Study on PIC32MX3XX / 4XX 32-Bit ControllerOverview Study on PIC32MX3XX / 4XX 32-Bit Controller
Overview Study on PIC32MX3XX / 4XX 32-Bit ControllerPremier Farnell
 
Curso de alisado brasileño
Curso de alisado brasileñoCurso de alisado brasileño
Curso de alisado brasileñoasunsol
 
Np presentación lotus exige gt
Np presentación lotus exige gtNp presentación lotus exige gt
Np presentación lotus exige gtDolcevitacoruna
 
Proyecto final productos - sede chitre
Proyecto final   productos - sede chitreProyecto final   productos - sede chitre
Proyecto final productos - sede chitreisaepanama
 

Andere mochten auch (7)

Overview Study on PIC32MX3XX / 4XX 32-Bit Controller
Overview Study on PIC32MX3XX / 4XX 32-Bit ControllerOverview Study on PIC32MX3XX / 4XX 32-Bit Controller
Overview Study on PIC32MX3XX / 4XX 32-Bit Controller
 
Rio negro instructivo para presidentes_de_mesa_elecciones_14-06-2015
Rio negro instructivo para presidentes_de_mesa_elecciones_14-06-2015Rio negro instructivo para presidentes_de_mesa_elecciones_14-06-2015
Rio negro instructivo para presidentes_de_mesa_elecciones_14-06-2015
 
Curso de alisado brasileño
Curso de alisado brasileñoCurso de alisado brasileño
Curso de alisado brasileño
 
Monitor slideshow
Monitor slideshowMonitor slideshow
Monitor slideshow
 
Trabajo vanesaa beltran
Trabajo vanesaa beltranTrabajo vanesaa beltran
Trabajo vanesaa beltran
 
Np presentación lotus exige gt
Np presentación lotus exige gtNp presentación lotus exige gt
Np presentación lotus exige gt
 
Proyecto final productos - sede chitre
Proyecto final   productos - sede chitreProyecto final   productos - sede chitre
Proyecto final productos - sede chitre
 

Ähnlich wie Add spatial data to MongoDB

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 ZendSteven Pousty
 
Spatial script for CIMA
Spatial script for CIMASpatial script for CIMA
Spatial script for CIMASteven Pousty
 
Script for Spatial Mongo
Script for Spatial MongoScript for Spatial Mongo
Script for Spatial MongoSteven Pousty
 
Spatial script for MongoBoulder
Spatial script for MongoBoulderSpatial script for MongoBoulder
Spatial script for MongoBoulderSteven Pousty
 
9b. Document-Oriented Databases lab
9b. Document-Oriented Databases lab9b. Document-Oriented Databases lab
9b. Document-Oriented Databases labFabio Fumarola
 
Chapman: Building a High-Performance Distributed Task Service with MongoDB
Chapman: Building a High-Performance Distributed Task Service with MongoDBChapman: Building a High-Performance Distributed Task Service with MongoDB
Chapman: Building a High-Performance Distributed Task Service with MongoDBMongoDB
 
Building Your First MongoDB Application
Building Your First MongoDB ApplicationBuilding Your First MongoDB Application
Building Your First MongoDB ApplicationTugdual Grall
 
Apache Hadoop Shell Rewrite
Apache Hadoop Shell RewriteApache Hadoop Shell Rewrite
Apache Hadoop Shell RewriteAllen Wittenauer
 
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...MongoDB
 
Back to Basics Webinar 2 - Your First MongoDB Application
Back to  Basics Webinar 2 - Your First MongoDB ApplicationBack to  Basics Webinar 2 - Your First MongoDB Application
Back to Basics Webinar 2 - Your First MongoDB ApplicationJoe Drumgoole
 
Back to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB ApplicationBack to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB ApplicationMongoDB
 
QA Fes 2016. Ярослав Пернеровский. Не Jav'ой единой. Пример автоматизации тес...
QA Fes 2016. Ярослав Пернеровский. Не Jav'ой единой. Пример автоматизации тес...QA Fes 2016. Ярослав Пернеровский. Не Jav'ой единой. Пример автоматизации тес...
QA Fes 2016. Ярослав Пернеровский. Не Jav'ой единой. Пример автоматизации тес...QAFest
 
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...MongoDB
 
Building your first application w/mongoDB MongoSV2011
Building your first application w/mongoDB MongoSV2011Building your first application w/mongoDB MongoSV2011
Building your first application w/mongoDB MongoSV2011Steven Francia
 
はじめてのMongoDB
はじめてのMongoDBはじめてのMongoDB
はじめてのMongoDBTakahiro Inoue
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHPHow to use MongoDB with CakePHP
How to use MongoDB with CakePHPichikaway
 
Back to Basics, webinar 2: La tua prima applicazione MongoDB
Back to Basics, webinar 2: La tua prima applicazione MongoDBBack to Basics, webinar 2: La tua prima applicazione MongoDB
Back to Basics, webinar 2: La tua prima applicazione MongoDBMongoDB
 
San Francisco Java User Group
San Francisco Java User GroupSan Francisco Java User Group
San Francisco Java User Groupkchodorow
 

Ähnlich wie Add spatial data to MongoDB (20)

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
 
Spatial script for CIMA
Spatial script for CIMASpatial script for CIMA
Spatial script for CIMA
 
Script for Spatial Mongo
Script for Spatial MongoScript for Spatial Mongo
Script for Spatial Mongo
 
Spatial script for MongoBoulder
Spatial script for MongoBoulderSpatial script for MongoBoulder
Spatial script for MongoBoulder
 
9b. Document-Oriented Databases lab
9b. Document-Oriented Databases lab9b. Document-Oriented Databases lab
9b. Document-Oriented Databases lab
 
Chapman: Building a High-Performance Distributed Task Service with MongoDB
Chapman: Building a High-Performance Distributed Task Service with MongoDBChapman: Building a High-Performance Distributed Task Service with MongoDB
Chapman: Building a High-Performance Distributed Task Service with MongoDB
 
Building Your First MongoDB Application
Building Your First MongoDB ApplicationBuilding Your First MongoDB Application
Building Your First MongoDB Application
 
Apache Hadoop Shell Rewrite
Apache Hadoop Shell RewriteApache Hadoop Shell Rewrite
Apache Hadoop Shell Rewrite
 
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
 
Back to Basics Webinar 2 - Your First MongoDB Application
Back to  Basics Webinar 2 - Your First MongoDB ApplicationBack to  Basics Webinar 2 - Your First MongoDB Application
Back to Basics Webinar 2 - Your First MongoDB Application
 
Back to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB ApplicationBack to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB Application
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
QA Fes 2016. Ярослав Пернеровский. Не Jav'ой единой. Пример автоматизации тес...
QA Fes 2016. Ярослав Пернеровский. Не Jav'ой единой. Пример автоматизации тес...QA Fes 2016. Ярослав Пернеровский. Не Jav'ой единой. Пример автоматизации тес...
QA Fes 2016. Ярослав Пернеровский. Не Jav'ой единой. Пример автоматизации тес...
 
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
 
Building your first application w/mongoDB MongoSV2011
Building your first application w/mongoDB MongoSV2011Building your first application w/mongoDB MongoSV2011
Building your first application w/mongoDB MongoSV2011
 
はじめてのMongoDB
はじめてのMongoDBはじめてのMongoDB
はじめてのMongoDB
 
Books
BooksBooks
Books
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHPHow to use MongoDB with CakePHP
How to use MongoDB with CakePHP
 
Back to Basics, webinar 2: La tua prima applicazione MongoDB
Back to Basics, webinar 2: La tua prima applicazione MongoDBBack to Basics, webinar 2: La tua prima applicazione MongoDB
Back to Basics, webinar 2: La tua prima applicazione MongoDB
 
San Francisco Java User Group
San Francisco Java User GroupSan Francisco Java User Group
San Francisco Java User Group
 

Mehr von 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 + DockerSteven Pousty
 
Introduction to PaaS for application developers
Introduction to PaaS for application developersIntroduction to PaaS for application developers
Introduction to PaaS for application developersSteven Pousty
 
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 cloudSteven Pousty
 
Workshop For pycon13
Workshop For pycon13Workshop For pycon13
Workshop For pycon13Steven Pousty
 
Build a PaaS with OpenShift Origin
Build a PaaS with OpenShift OriginBuild a PaaS with OpenShift Origin
Build a PaaS with OpenShift OriginSteven Pousty
 
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 ecosystemSteven 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 ManagementSteven Pousty
 
Open shift intro for Philly PUG
Open shift intro for Philly PUGOpen shift intro for Philly PUG
Open shift intro for Philly PUGSteven Pousty
 
Open shift intro for Philly PUG
Open shift intro for Philly PUGOpen shift intro for Philly PUG
Open shift intro for Philly PUGSteven Pousty
 
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 AppSteven 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 ApplicationSteven Pousty
 

Mehr von Steven Pousty (12)

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
 
Workshop For pycon13
Workshop For pycon13Workshop For pycon13
Workshop For pycon13
 
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
 
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
 
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
 

Kürzlich hochgeladen

Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
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 2024Rafal Los
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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 WorkerThousandEyes
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
[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.pdfhans926745
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 

Kürzlich hochgeladen (20)

Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
[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
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 

Add spatial data to MongoDB

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