SlideShare une entreprise Scribd logo
1  sur  17
Build Your Own Foursquare!
    Develop GeoSpatial Apps with
         Zend, MongoDB and
              OpenShift
      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



              SIGN UP CODE:
                 zendcon

2
Git repo for the data and code
https://github.com/thesteve0/parks-php-zf2


Please remember the point here is not that this is great PHP or ZF2 code. This is
mostly to show you how to do spatial queries in mongo through PHP. The main file
with that code is:

https://github.com/thesteve0/parks-php-
zf2/blob/master/module/Application/src/Application/Controller/IndexController.php

The data file is in the root dir and is called parks.json




3
Assumptions
    1) You can use the command line
    2) You are comfortable with Mongo command line
    3) Please ask questions – though since there are things I
       really want to cover, they may have to wait until the
       end or after the session




4
What is OpenShift?

    Red Hat’s free platform as a service for applications in the cloud.




5
6
    Dalbera on Flickr
Kind of like Amazon, right? Nope.




7
Cook24v on Flickr
 8
9
What’s supported?




10
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




11
On to spatial!




12
Spatial is fun
 The only spatial functionality Mongo currently has is:
 1) Near
 2) Containment


 All of it is laid out on one page:
 http://www.mongodb.org/display/DOCS/Geospatial+Inde
 xing
 First link on a google search for “mongodb spatial
 indexing”

13
Caveats
 1. Assumes coords. are between -180 and 180
 2. Can handle any 2D coordinates
 3. Has methods to handle curvature of the earth
    (spherical)




14
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 } }

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




15
Demo
 1. I have an app and a mongo instance running
 2. Load some spatial data in JSON format
 3. Make the 2d index
 4. Do some fun spatial and mongoDB work
 5. Show some PHP code that takes advantage of it




16
Conclusion
 1. Spatial is easy and fun on Mongo with PHP
 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:
                     zendcon
        http://openshift.redhat.com
17

Contenu connexe

Tendances

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 GeoServerNg'eno Victor
 
Mongo db bangalore
Mongo db bangaloreMongo db bangalore
Mongo db bangaloreMongoDB
 
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
 
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 servercorehard_by
 
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...Sathyajith Bhat
 
GPFS - graphical intro
GPFS - graphical introGPFS - graphical intro
GPFS - graphical introAlex Balk
 
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 FunctionsRuncy Oommen
 
Redis clustering
Redis clusteringRedis clustering
Redis clusteringRavi Yasas
 
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
 
Confessions of a relational addict
Confessions of a relational addictConfessions of a relational addict
Confessions of a relational addictChandra Patni
 
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 applicationShekhar Gulati
 
Dockerizing Rails
Dockerizing RailsDockerizing Rails
Dockerizing RailsiGbanam
 
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 typeKiwamu Okabe
 
Fluentd: Unified Logging Layer at CWT2014
Fluentd: Unified Logging Layer at CWT2014Fluentd: Unified Logging Layer at CWT2014
Fluentd: Unified Logging Layer at CWT2014N Masahiro
 
Micro ORM vs Entity Framework
Micro ORM vs Entity FrameworkMicro ORM vs Entity Framework
Micro ORM vs Entity FrameworkAxilis
 
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...sangam biradar
 
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)Ewan Slater
 
Блохин Леонид - "Mist, как часть Hydrosphere"
Блохин Леонид - "Mist, как часть Hydrosphere"Блохин Леонид - "Mist, как часть Hydrosphere"
Блохин Леонид - "Mist, как часть Hydrosphere"Provectus
 

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
 
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
 
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
 
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...
 
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
 
Redis clustering
Redis clusteringRedis clustering
Redis clustering
 
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
 
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
 
Dockerizing Rails
Dockerizing RailsDockerizing Rails
Dockerizing Rails
 
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
 
Fluentd: Unified Logging Layer at CWT2014
Fluentd: Unified Logging Layer at CWT2014Fluentd: Unified Logging Layer at CWT2014
Fluentd: Unified Logging Layer at CWT2014
 
Micro ORM vs Entity Framework
Micro ORM vs Entity FrameworkMicro ORM vs Entity Framework
Micro ORM vs Entity Framework
 
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...
 
Docker and stuff
Docker and stuffDocker and stuff
Docker and stuff
 
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"
 

Similaire à Spatial mongo for PHP and Zend

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
 
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...OpenShift Origin
 
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 MongoDBMongoDB
 
Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Shekhar Gulati
 
Workshop For pycon13
Workshop For pycon13Workshop For pycon13
Workshop For pycon13Steven Pousty
 
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 ApplicationMichael Lynn
 
MongoDB on CloudFoundry
MongoDB on CloudFoundryMongoDB on CloudFoundry
MongoDB on CloudFoundryYohei Sasaki
 
MongoDB on CloudFoundry
MongoDB on CloudFoundryMongoDB on CloudFoundry
MongoDB on CloudFoundryYohei Sasaki
 
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 ...OpenShift Origin
 
MongoDB & Hadoop, Sittin' in a Tree
MongoDB & Hadoop, Sittin' in a TreeMongoDB & Hadoop, Sittin' in a Tree
MongoDB & Hadoop, Sittin' in a TreeMongoDB
 
Deploying PHP on PaaS: Why and How?
Deploying PHP on PaaS: Why and How?Deploying PHP on PaaS: Why and How?
Deploying PHP on PaaS: Why and How?Docker, Inc.
 
Introducing with MongoDB
Introducing with MongoDBIntroducing with MongoDB
Introducing with MongoDBMahbub Tito
 
3-Way Scripts as a Practical Platform for Secure Distributed Code in Clouds
3-Way Scripts as a Practical Platform for Secure Distributed Code in Clouds3-Way Scripts as a Practical Platform for Secure Distributed Code in Clouds
3-Way Scripts as a Practical Platform for Secure Distributed Code in CloudsTokyo University of Science
 
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 MongoDBMongoDB
 
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 MinutesAndrás Fehér
 
Introduction to using MongoDB with Ruby
Introduction to using MongoDB with RubyIntroduction to using MongoDB with Ruby
Introduction to using MongoDB with RubyJonathan Holloway
 
Splunk's Hunk: A Powerful Way to Visualize Your Data Stored in MongoDB
Splunk's Hunk: A Powerful Way to Visualize Your Data Stored in MongoDBSplunk's Hunk: A Powerful Way to Visualize Your Data Stored in MongoDB
Splunk's Hunk: A Powerful Way to Visualize Your Data Stored in MongoDBMongoDB
 
Midwest php 2013 deploying php on paas- why & how
Midwest php 2013   deploying php on paas- why & howMidwest php 2013   deploying php on paas- why & how
Midwest php 2013 deploying php on paas- why & howdotCloud
 

Similaire à Spatial mongo for PHP and Zend (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
 
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...
 
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
 
Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud
 
Workshop For pycon13
Workshop For pycon13Workshop For pycon13
Workshop For pycon13
 
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
 
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 ...
 
MongoDB & Hadoop, Sittin' in a Tree
MongoDB & Hadoop, Sittin' in a TreeMongoDB & Hadoop, Sittin' in a Tree
MongoDB & Hadoop, Sittin' in a Tree
 
Deploying PHP on PaaS: Why and How?
Deploying PHP on PaaS: Why and How?Deploying PHP on PaaS: Why and How?
Deploying PHP on PaaS: Why and How?
 
Introducing with MongoDB
Introducing with MongoDBIntroducing with MongoDB
Introducing with MongoDB
 
3-Way Scripts as a Practical Platform for Secure Distributed Code in Clouds
3-Way Scripts as a Practical Platform for Secure Distributed Code in Clouds3-Way Scripts as a Practical Platform for Secure Distributed Code in Clouds
3-Way Scripts as a Practical Platform for Secure Distributed Code in Clouds
 
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
 
New paradigms
New paradigmsNew paradigms
New paradigms
 
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
 
Introduction to using MongoDB with Ruby
Introduction to using MongoDB with RubyIntroduction to using MongoDB with Ruby
Introduction to using MongoDB with Ruby
 
Splunk's Hunk: A Powerful Way to Visualize Your Data Stored in MongoDB
Splunk's Hunk: A Powerful Way to Visualize Your Data Stored in MongoDBSplunk's Hunk: A Powerful Way to Visualize Your Data Stored in MongoDB
Splunk's Hunk: A Powerful Way to Visualize Your Data Stored in MongoDB
 
MongoDB Part 2
MongoDB Part 2MongoDB Part 2
MongoDB Part 2
 
Midwest php 2013 deploying php on paas- why & how
Midwest php 2013   deploying php on paas- why & howMidwest php 2013   deploying php on paas- why & how
Midwest php 2013 deploying php on paas- why & how
 

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 + 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
 
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
 
Spatial script for MongoBoulder
Spatial script for MongoBoulderSpatial script for MongoBoulder
Spatial script for MongoBoulderSteven Pousty
 
Spatial script for CIMA
Spatial script for CIMASpatial script for CIMA
Spatial script for CIMASteven 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 2012Steven 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 ZendSteven 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
 
Script for Spatial Mongo
Script for Spatial MongoScript for Spatial Mongo
Script for Spatial MongoSteven 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
 

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

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 productivityPrincipled Technologies
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
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 2024The Digital Insurer
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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...apidays
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
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
 
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.pdfUK Journal
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 

Dernier (20)

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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

Spatial mongo for PHP and Zend

  • 1. Build Your Own Foursquare! Develop GeoSpatial Apps with Zend, MongoDB and OpenShift 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 SIGN UP CODE: zendcon 2
  • 3. Git repo for the data and code https://github.com/thesteve0/parks-php-zf2 Please remember the point here is not that this is great PHP or ZF2 code. This is mostly to show you how to do spatial queries in mongo through PHP. The main file with that code is: https://github.com/thesteve0/parks-php- zf2/blob/master/module/Application/src/Application/Controller/IndexController.php The data file is in the root dir and is called parks.json 3
  • 4. Assumptions 1) You can use the command line 2) You are comfortable with Mongo command line 3) Please ask questions – though since there are things I really want to cover, they may have to wait until the end or after the session 4
  • 5. What is OpenShift? Red Hat’s free platform as a service for applications in the cloud. 5
  • 6. 6 Dalbera on Flickr
  • 7. Kind of like Amazon, right? Nope. 7
  • 9. 9
  • 11. 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 11
  • 13. Spatial is fun The only spatial functionality Mongo currently has is: 1) Near 2) Containment All of it is laid out on one page: http://www.mongodb.org/display/DOCS/Geospatial+Inde xing First link on a google search for “mongodb spatial indexing” 13
  • 14. Caveats 1. Assumes coords. are between -180 and 180 2. Can handle any 2D coordinates 3. Has methods to handle curvature of the earth (spherical) 14
  • 15. 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 } } 2) Make a 2d index db.places.ensureIndex( { loc : "2d" } ) 15
  • 16. Demo 1. I have an app and a mongo instance running 2. Load some spatial data in JSON format 3. Make the 2d index 4. Do some fun spatial and mongoDB work 5. Show some PHP code that takes advantage of it 16
  • 17. Conclusion 1. Spatial is easy and fun on Mongo with PHP 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: zendcon http://openshift.redhat.com 17