Data + Visualization Toronto Meetup 4: The Google Maps API

Preview:

DESCRIPTION

Trimmed version of slides shown at the Data + Visualization Toronto Meetup Group's Fourth Meetup. Contains information about the Google Maps API, and Google Geocoding API.

Citation preview

Raining Cats and Dogs

DVTO 4: The Google Maps API

http://www.toronto.ca/fire/cadinfo/livecad.htm

Slides Removed

• See http://www.torontofirecalls.com for app

• http://www.toronto.ca/fire/cadinfo/livecad.htm

• http://www.toronto.ca/fire/cadinfo/livecad.xml

Designs and Compromises

• “First make it possible. Then make it beautiful. Then make it fast.” -Nathan Marz

Make it Possible

• Node JS and Redis, because programming

• Revert to Rails and Postgres, because spaghetti

Every 5 Minutes do X1. Custom Rake Task w/ Heroku Scheduler

2. Clockwork and Delayed Job (OMG $$$)

3. Clockwork and Delayed Job with Workless

4. Switch to WebFaction

5. Bare Cron

6. Cron by Whenever Gem

Slide Removed

• http://mapicons.nicolasmollet.com/

Make it Fast(er)

• NewRelic development agent -> Profiled

• Event retrieval on click? Not scalable

• Optimized AR Queries

• InfoWindow Generation/Retrieval to AJAX

Part 4Google Geocoding and

Maps API’s

Google Geocoding API

• http://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=true

• JSON or XML, HTTP or HTTPS

• 2,500 requests per 24 hour period.

• Also a rate limit, so sleep during bulk geocodes

Reverse Geocoding

• Have location, need address.

• http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true

Slide Removed

• https://github.com/alexreisner/geocoder

Geocode Happy

1. Realistic use case?

2. Have a strategy.

3. Check the TOS.

Markers on a Map

Step 1

Step 2

Step 3

Step 4

Step 5

Slide Removed

• See https://github.com/apneadiving/Google-Maps-for-Rails

Bonus Resources

• CartoDB and Torque

• Google Maps Mania Blog

Slide Removed

• See thedirt.co

Slide Removed

• See padmapper.com

Slide Removed

• http://lifewatch.inbo.be/blog/posts/tracking-eric.html

Code & Ironcodeandiron.co

m@codeandiron

matt@codeandiron.com

@mattholtomTO

Matt Holtom