Second in the mobile series. Our mobile application takes shape as we build out a schema to support geo-specific data and friend finding. Learn how to use MongoDB geo-indexing for real-time proximity matching and gather analytics with the aggregation framework.
6. 6
The Scavenger Hunt App
Basic Requirements
• Mark target points
• Identify our users
7. 7
The Scavenger Hunt App
Basic Requirements
• Mark target points
• Identify our users
• Mark users’ progress
during hunts
8. 8
Waypoint
{ _id: ObjectId(),
user: UUID,
tour: UUDI
name: "Doug's Dogs",
desc: "The best hot-dog",
clues: [
"Hungry for a Coney Island?",
"Ask for Dr. Frankenfurter",
"Look for the hot dog stand"
],
"geometry": {
"type": "Point",
"coordinates": [125.6, 10.1] }
};
9. 9
Waypoint
{ _id: ObjectId(),
user: UUID,
tour: UUDI
name: "Doug's Dogs",
desc: "The best hot-dog",
clues: [
"Hungry for a Coney Island?",
"Ask for Dr. Frankenfurter",
"Look for the hot dog stand"
],
"geometry": {
"type": "Point",
"coordinates": [125.6, 10.1] }
};
Geospacial Index:
ensureIndex(
{ geometry: “2dsphere” }
)
19. 19
Polygon
Data Driven Decision
• How many people live around this area
• How many of my customers are around this distribution center
• What time of the day do they actually get in front of the shop
• Where are my competitors located
• How much time does it take get from A -> B
43. 43
Coordinate Reference System
• A system to locate geographical entities
• WGS84 datum
• Geoid - the shape of the surface of the oceans
• EGM96 gravitational model
"crs": {
"type": "name",
"properties": {
"name": "urn:ogc:def:crs:OGC:1.3:CRS84"
}
}