SlideShare a Scribd company logo
Location Based Services Lalit Kapoor - @idefine Washington, DC Monday, June 27, 2011
MongoDB Is Easy! Document Object Store JSON (BSON) Schema-less Multiple language support (c++ to python to nodejs) Easy-to-Scale (http://www.mongodb.org/display/DOCS/Production+Deployments) Support for geospatial indexing and queries
Building Your First Location Aware App Pulse Mobile
Pulse Help people in emergency situations Find the closest hospital Notify important contacts (immediate family, friends, primary care physician, etc) Extra features that would make this app rock! Provide real-time updates of your location to hospital and contacts Send pictures to hospital Get ER wait times (this data is available in some states) Notify hospital of important medical information: blood-type, allergies, current medications, EMR, etc (integrate with google health/careverge) Integrate with 3rd party devices (watches, wristbands, etc) that know your vitals such as: blood pressure and heart rate. Transmit to your smart phone and then to hospital and contacts
LBS w/MongoDB Get or collect some location data (addresses are fine) Store it in mongoDB if data is in tsv/csv/json use mongoimport find lat/lng if you don’t already have it use Google’s MAP API to find lat/long if you have an address build a 2d index (lat/lng) db.collection.ensureIndex({field:”2d”}); let the geospatial queries begin!
Get Some Data Location of Hospitals In The United States Medicare.gov has information about the quality of care at each hospital - this data also happens to include the address for over 4000 hospitals in the US
Import into MongoDB mongoimport --headerline --type csv --drop --db mongodc --collection hospitals --file OutcomeofCareMeasures.csv
Geospatial Indexing db.places.ensureIndex({loc:”2d”}); / (compounded indexes):  db.places.ensureIndex( { loc : "2d" , category : 1 } ); Geohash is calculated and stored in a B-Tree Sharding Capable (as of 1.7.2 - Thanks Mathias - from 10gen) Current Limitations “Doesn’t currently handle wrapping at the poles or at the transition from -180° to +180° longitude, however we detect when a search would wrap and raise an error” (Resolved in 1.9+) Need to use geoNear command instead of $near for now when sharding (see JIRA SERVER-1981) - Proposed for resolution in 2011 geoNear not in the pymongoDrivers! Eval Hack - http://permalink.gmane.org/gmane.comp.db.mongodb.user/67 (Thanks smsfail on #mongodb) eval_result = db.eval('db.runCommand( { geoNear : "location" , near :[%s,%s], num : %s } );' % (lat, lon, num)) results = eval_result.get('results', []) Do not shard on a geo key - works, but inefficient. See JIRA SERVER-1982.
Geospatial Querying geoNeargives you back the distance  (in radians if sphere=true) Results are sorted by distance away from points $near vs. $nearSphere (1.7.0) $within [box, center, polygon] instead of $near Not sorted by distance More examples and details on the wiki
Questions? Lalit Kapoor - @idefine

More Related Content

Similar to MongoDC - Location Aware Applications w/mongodb

Geo-Indexing w/MongoDB
Geo-Indexing w/MongoDBGeo-Indexing w/MongoDB
Geo-Indexing w/MongoDB
Lalit Kapoor
 
LiveLinkedData - TransWebData - Nantes 2013
LiveLinkedData - TransWebData - Nantes 2013LiveLinkedData - TransWebData - Nantes 2013
LiveLinkedData - TransWebData - Nantes 2013
Luis Daniel Ibáñez
 
PRAFUL_HADOOP
PRAFUL_HADOOPPRAFUL_HADOOP
PRAFUL_HADOOP
PRAFUL DASH
 
PRAFUL_HADOOP
PRAFUL_HADOOPPRAFUL_HADOOP
PRAFUL_HADOOP
PRAFUL DASH
 
MongoDB Mobile - Bringing the Power of MongoDB to your Device
MongoDB Mobile - Bringing the Power of MongoDB to your DeviceMongoDB Mobile - Bringing the Power of MongoDB to your Device
MongoDB Mobile - Bringing the Power of MongoDB to your Device
MongoDB
 
MongoDB.local Berlin: MongoDB Mobile
MongoDB.local Berlin: MongoDB MobileMongoDB.local Berlin: MongoDB Mobile
MongoDB.local Berlin: MongoDB Mobile
MongoDB
 
MongoDB.local Atlanta: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB.local Atlanta: MongoDB Mobile: Bringing the Power of MongoDB to Your ...MongoDB.local Atlanta: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB.local Atlanta: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB
 
Switch to Backend 2023
Switch to Backend 2023Switch to Backend 2023
Json to hive_schema_generator
Json to hive_schema_generatorJson to hive_schema_generator
Json to hive_schema_generator
Payal Jain
 
Hive + Tez: A Performance Deep Dive
Hive + Tez: A Performance Deep DiveHive + Tez: A Performance Deep Dive
Hive + Tez: A Performance Deep Dive
DataWorks Summit
 
Hive+Tez: A performance deep dive
Hive+Tez: A performance deep diveHive+Tez: A performance deep dive
Hive+Tez: A performance deep dive
t3rmin4t0r
 
MongoDB Introduction and Data Modelling
MongoDB Introduction and Data Modelling MongoDB Introduction and Data Modelling
MongoDB Introduction and Data Modelling
Sachin Bhosale
 
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
GeeksLab Odessa
 
MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB
 
Capstone Final
Capstone FinalCapstone Final
Capstone Final
Ka Chun Chan
 
Inroduction to Big Data
Inroduction to Big DataInroduction to Big Data
Inroduction to Big Data
Omnia Safaan
 
Developing applications with Cloud Services #javaone 2012
Developing applications with Cloud Services  #javaone 2012Developing applications with Cloud Services  #javaone 2012
Developing applications with Cloud Services #javaone 2012
Chris Richardson
 
"Building Data Warehouse with Google Cloud Platform", Artem Nikulchenko
"Building Data Warehouse with Google Cloud Platform",  Artem Nikulchenko"Building Data Warehouse with Google Cloud Platform",  Artem Nikulchenko
"Building Data Warehouse with Google Cloud Platform", Artem Nikulchenko
Fwdays
 
The RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with OracleThe RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with Oracle
Emiliano Pecis
 
Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014
Brian Cavalier
 

Similar to MongoDC - Location Aware Applications w/mongodb (20)

Geo-Indexing w/MongoDB
Geo-Indexing w/MongoDBGeo-Indexing w/MongoDB
Geo-Indexing w/MongoDB
 
LiveLinkedData - TransWebData - Nantes 2013
LiveLinkedData - TransWebData - Nantes 2013LiveLinkedData - TransWebData - Nantes 2013
LiveLinkedData - TransWebData - Nantes 2013
 
PRAFUL_HADOOP
PRAFUL_HADOOPPRAFUL_HADOOP
PRAFUL_HADOOP
 
PRAFUL_HADOOP
PRAFUL_HADOOPPRAFUL_HADOOP
PRAFUL_HADOOP
 
MongoDB Mobile - Bringing the Power of MongoDB to your Device
MongoDB Mobile - Bringing the Power of MongoDB to your DeviceMongoDB Mobile - Bringing the Power of MongoDB to your Device
MongoDB Mobile - Bringing the Power of MongoDB to your Device
 
MongoDB.local Berlin: MongoDB Mobile
MongoDB.local Berlin: MongoDB MobileMongoDB.local Berlin: MongoDB Mobile
MongoDB.local Berlin: MongoDB Mobile
 
MongoDB.local Atlanta: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB.local Atlanta: MongoDB Mobile: Bringing the Power of MongoDB to Your ...MongoDB.local Atlanta: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB.local Atlanta: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
 
Switch to Backend 2023
Switch to Backend 2023Switch to Backend 2023
Switch to Backend 2023
 
Json to hive_schema_generator
Json to hive_schema_generatorJson to hive_schema_generator
Json to hive_schema_generator
 
Hive + Tez: A Performance Deep Dive
Hive + Tez: A Performance Deep DiveHive + Tez: A Performance Deep Dive
Hive + Tez: A Performance Deep Dive
 
Hive+Tez: A performance deep dive
Hive+Tez: A performance deep diveHive+Tez: A performance deep dive
Hive+Tez: A performance deep dive
 
MongoDB Introduction and Data Modelling
MongoDB Introduction and Data Modelling MongoDB Introduction and Data Modelling
MongoDB Introduction and Data Modelling
 
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
 
MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
 
Capstone Final
Capstone FinalCapstone Final
Capstone Final
 
Inroduction to Big Data
Inroduction to Big DataInroduction to Big Data
Inroduction to Big Data
 
Developing applications with Cloud Services #javaone 2012
Developing applications with Cloud Services  #javaone 2012Developing applications with Cloud Services  #javaone 2012
Developing applications with Cloud Services #javaone 2012
 
"Building Data Warehouse with Google Cloud Platform", Artem Nikulchenko
"Building Data Warehouse with Google Cloud Platform",  Artem Nikulchenko"Building Data Warehouse with Google Cloud Platform",  Artem Nikulchenko
"Building Data Warehouse with Google Cloud Platform", Artem Nikulchenko
 
The RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with OracleThe RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with Oracle
 
Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014
 

Recently uploaded

20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Zilliz
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
TIPNGVN2
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 

Recently uploaded (20)

20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 

MongoDC - Location Aware Applications w/mongodb

  • 1. Location Based Services Lalit Kapoor - @idefine Washington, DC Monday, June 27, 2011
  • 2. MongoDB Is Easy! Document Object Store JSON (BSON) Schema-less Multiple language support (c++ to python to nodejs) Easy-to-Scale (http://www.mongodb.org/display/DOCS/Production+Deployments) Support for geospatial indexing and queries
  • 3. Building Your First Location Aware App Pulse Mobile
  • 4. Pulse Help people in emergency situations Find the closest hospital Notify important contacts (immediate family, friends, primary care physician, etc) Extra features that would make this app rock! Provide real-time updates of your location to hospital and contacts Send pictures to hospital Get ER wait times (this data is available in some states) Notify hospital of important medical information: blood-type, allergies, current medications, EMR, etc (integrate with google health/careverge) Integrate with 3rd party devices (watches, wristbands, etc) that know your vitals such as: blood pressure and heart rate. Transmit to your smart phone and then to hospital and contacts
  • 5. LBS w/MongoDB Get or collect some location data (addresses are fine) Store it in mongoDB if data is in tsv/csv/json use mongoimport find lat/lng if you don’t already have it use Google’s MAP API to find lat/long if you have an address build a 2d index (lat/lng) db.collection.ensureIndex({field:”2d”}); let the geospatial queries begin!
  • 6. Get Some Data Location of Hospitals In The United States Medicare.gov has information about the quality of care at each hospital - this data also happens to include the address for over 4000 hospitals in the US
  • 7. Import into MongoDB mongoimport --headerline --type csv --drop --db mongodc --collection hospitals --file OutcomeofCareMeasures.csv
  • 8. Geospatial Indexing db.places.ensureIndex({loc:”2d”}); / (compounded indexes): db.places.ensureIndex( { loc : "2d" , category : 1 } ); Geohash is calculated and stored in a B-Tree Sharding Capable (as of 1.7.2 - Thanks Mathias - from 10gen) Current Limitations “Doesn’t currently handle wrapping at the poles or at the transition from -180° to +180° longitude, however we detect when a search would wrap and raise an error” (Resolved in 1.9+) Need to use geoNear command instead of $near for now when sharding (see JIRA SERVER-1981) - Proposed for resolution in 2011 geoNear not in the pymongoDrivers! Eval Hack - http://permalink.gmane.org/gmane.comp.db.mongodb.user/67 (Thanks smsfail on #mongodb) eval_result = db.eval('db.runCommand( { geoNear : "location" , near :[%s,%s], num : %s } );' % (lat, lon, num)) results = eval_result.get('results', []) Do not shard on a geo key - works, but inefficient. See JIRA SERVER-1982.
  • 9. Geospatial Querying geoNeargives you back the distance  (in radians if sphere=true) Results are sorted by distance away from points $near vs. $nearSphere (1.7.0) $within [box, center, polygon] instead of $near Not sorted by distance More examples and details on the wiki

Editor's Notes

  1. Today I’m going to be talking about building location aware applications with mongodb
  2. If you’re new to mongodb, there are various reasons for why you may want to choose it as your database, but today I’m going to focus on its support for working with geospatial data
  3. I was planning on just pulling up the mongo shell and going through some geo commandsBut that would be boring and you’d learn more from the wiki anyway, so I decided to actually build an app that would show case some of mongo’s geo capabilitiesI made a mobile app called Pulse that utilizes the technologies you see on this pageWe will touch up on how each of these is used later on
  4. I use to work for a healthcare startup in DC and so I wanted to build something around health that was immediately useful to the end user
  5. So, let’s get started with what it takes to build an app like pulse
  6. Ok, so back to pulse
  7. By geohashing we transform the 2d search problem back into a 1d search problem, which is what B-tree indexes are good at.The geo-index of MongoDB encodes a geohash on top of a standard MongoDB b-tree. Geohashing is a way to divide a coordinate system into hierarchical buckets of grid shape.It basically divides an area in two for every bit and so on.A drawback of geohashing is the wrapping (-180 and 179 are very close for example), this can be solved by doing a grid search after the initial scan. It’s a bit comparable by how google maps loads the map images, it starts with the center of the viewport and then the surrounding areas are downloaded.