Since GeoJSON is a standard for storing geographic data in JSON format, it is a best practice to adhere to this format when storing geo-coordinates in Cloudant and CouchDB.
2. @rajrsingh
Watson Data Platform
Why
Geospatial?
• Humans are wired by evolution to think spatially
• Location tells you a lot about your data
• Design with Nature (1969)
pioneered the concept of
ecological planning.
Ian McHarg sets forth
the basic concepts that
were to develop later into
geographic information systems.
Courtesy Wikipedia
3. @rajrsingh
Watson Data Platform
Faking Geo
with
CouchDB
• Secondary index on X and Y
• Mango query X and Y
• Pull data to the client, then…
• Use PouchDB +
https://github.com/pouchdb/geopouch for
bounding box queries
or
• http://turfjs.org for more complete geospatial
analysis
7. @rajrsingh
Watson Data Platform
GeoJSON
Data Format – geometry property
• required: type property with a value such as
Point, LineString or Polygon
• required: coordinates property
– properties property
• all the other data
• optional in Cloudant/CouchDB
– type property set to Feature
– http://geojson.org
Humans are wired to think spatially
Go out to hunt, track prey and return home safely
Nomadic tribes, migration
Location tells you a lot about a user
At home or work
What are they near?
General demographics
Want to pull in demographic profies and give you all the schema flexbility. Today you’ll see the skeleton of a mobile app, you can use the flexible schema will let you scale without worrying
You can perform bounding box queries that return local results, but they may not be all that compelling because a simple rectangle may cross impassable barriers such as highways or rivers.
Multipoint polygons deliver better results for users. Here you see that the results are limited to a Lower East Side neighborhood in Manhattan.
Since GeoJSON is a standard for storing geographic data in JSON format, it is a best practice to adhere to this format when storing geo-coordinates in Cloudant.
GeoJSON format consists of three parts:
The geometry section contains two fields: the coordinates and the type, such as Point, LineString, or Polygon.
The properties section contains other optional data.
And the type section must be set to “Feature”.
The coordinates must adhere to the GeoJSON standard, but the properties object and type field are not required.
GeoJSON assumes that coordinates are stored as follows in 4D scenarios: (x-axis, y-axis, z-axis, temporal) which equates to (longitude, latitude, height, temporal). Keep it in mind as most people think in terms of latitude, longitude order rather than longitude, latitude.
For details on the accuracy and precision of coordinate data, refer to the Geographic Information Systems page on StackExchange. http://gis.stackexchange.com/questions/8650/how-to-measure-the-accuracy-of-latitude-and-longitude/8674#8674
Since GeoJSON is a standard for storing geographic data in JSON format, it is a best practice to adhere to this format when storing geo-coordinates in Cloudant.
GeoJSON format consists of three parts:
The geometry section contains two fields: the coordinates and the type, such as Point, LineString, or Polygon.
The properties section contains other optional data.
And the type section must be set to “Feature”.
The coordinates must adhere to the GeoJSON standard, but the properties object and type field are not required.
GeoJSON assumes that coordinates are stored as follows in 4D scenarios: (x-axis, y-axis, z-axis, temporal) which equates to (longitude, latitude, height, temporal). Keep it in mind as most people think in terms of latitude, longitude order rather than longitude, latitude.
For details on the accuracy and precision of coordinate data, refer to the Geographic Information Systems page on StackExchange. http://gis.stackexchange.com/questions/8650/how-to-measure-the-accuracy-of-latitude-and-longitude/8674#8674
In Cloudant, geospatial relations are specified by the relation query parameter. Cloudant Geo supports the following standard geospatial relations:
Bbox
Contains
Crosses
Disjoint
Equals
Intersects
Overlaps
Touches
Within
Refer to the Geospatial Relationships section of the documentation for complete details on each of these relations.