Unleash your map data: Cloud computing for geospatial applications
Geo – Tom Manshreck
The Google Maps API made geospatial development accessible to all but hosting your data remains complex and time consuming. This session will detail the services Google offers for storing your geospatial data in the cloud, illustrate the ways in which that data can be accessed and visualized, and walk through development of a retail store finder using these technologies.
Session type: 101
Attendee requirements: Experience developing web based applications that search over or visualise geospatial data is helpful but not essential.
Tags: Maps, Maps API, Data, Cloud, Geospatial
Hashtag: #geo4
Date: Wednesday May 19
Time: 4:15pm-5:15pm
Room: 4
Live Notes:
View live notes and ask questions about this session on Google Wave http://bit.ly/waveio
Tell us what you think of the I/O sessions: http://haveasec.com/io
Starting in a few minutes…
Speaker: Tom Manshreck
Maps Data API
How you can use Maps Data API to create a mashup
Private:
- My Hikes
- My Favorite Coffee Shops
- Shared
- Bike Trails
- Restaurants
- Public
- Store Finders,etc
Why store geospatial data in the cloud?
- Safer
- Exposed via multiple interfaces
- My Maps UI
- Maps Data API
- Accessible from any browser/app/server
- Open standards
Maps Data API?
- Interface to Maps Data stored in Google cloud
- REST-ish
- Operations initiated through URL requests (feeds)
Feed of the Maps Data API
- Manipulate 3 entities
- Maps ( collection of data)
- Features ( datum per map)
- Access Control Lists (per map)
- Provides searches – spatial and attribute search
POST acts to create Map
Initial Map Data can be provdied as XML, CSV or KML(best to manipulate)
Basic Feature Feed
POST acts to create Feature in Map
Features are KML
- <Point>
- <LineString>
- <Polygon>
Authentication option
- AuthSub
- OAuth
- Authorizaion via ACLs
- Specify Access on default (everyone) or per user@gmail.com
Maps Data API
URLs are a pain
Use a client library instead
- Java
- Python
- JavaScript
Loading the Maps Data API: JavaScript
- Use Google Common Loader
- Use AuthSub to redirect to Google Login (checks login status)
- Have an IMG to hold cookie token (important)
Creating Map – simple example callback functions
Application Design Specification
- coffee rating mobile application
- use Maps JavaScript API V3
- Uses Geolocation
- Allows you to click and add coffee info
- Data populated using maps data API
- Implement search over are for coffee
show application example:
- want to click and add a coffee place
- asks you to login to grant access
- click and name, add options about coffee, rating
Set up Map
- using global variables, filling in with callback functions
- create info window,geocoder and map
- call geolocate function checking where it exists with lat long – good idea to have default
- add event listener
Opening the coffee data form
- Getting coffee data
- set content of HTML and position
take out form values and pass to another function
Add features
- Get the Map feed for your Map
- Get the MapEntry and feature feed
- Populate a FeatureEntry
- Insert the FeatureEntry using the Feature Feed URL
set KML content with point values in this example (lat and long) and create a placemark point
HTTP POST to map and create a feature
Searching over your data
- Use a feature feed /snippet? query
- Pass attribute parameters in a mq parameter as key/value pair
- Spatial searches are by radius or bounding box
- radius requires a lat long center
- radius expressed in meters
- optional sortby parameter
sample shown
get back an array of features
pull out arbitrary data and populate it on a map
A Case Study – IHG Hotels – more robust example
Hotel Company with 4500 hotels to keep track of
heavy lifting done by Google
gathered data about hotels (lat long, pool, internet, etc.) and pushed data out to cloud and then display in different ways
upload hotel data nightly
simple REST query to perform search and then display data in map
iPhone and Android apps available too
using Google Maps Data API – problem resolved in 24 hours; traditional way would have taken a lot longer
It’s Simple! Push your data, query it, results returned quickly, reliable
- JSON feature Upload/Download coming soon
- no need to parse KML
- perfect match for users of the JavaSCript library
- FusionTables in the JavaScript V3
- have columns and form SQL queries