Remote Geocoding Ed Freyfogle London Perl Workshop, 4 Dec 2010
What is geocoding? Geocoding is the process of finding associated geographic coordinates (often expressed as latitude and ...
remote geocoding? http://www.flickr.com/photos/jennratonmort Magical internet elves try to answer your every  geocoding wh...
The problem: many remote geocoders Geo::Coder::Google Geo::Coder::Yahoo Geo::Coder::Placefinder Geo::Coder::Mapquest Geo::...
the small print registration, keys rate limits usage limits http://www.flickr.com/photos/mrwilleeumm
But different … quality  query formats response formats concepts of precision version changes http://www.flickr.com/photos...
Geo::Coder::Many One interface Single precision definition Intelligent caching and failover Easily set picker and filter m...
And now for some code http://www.flickr.com/photos/vermininc use Geo::Coder::Locatorize; use Geo::Coder::WhereIzIt; use Ge...
…  continued http://www.flickr.com/photos/vermininc # Create and add a geocoder my $Locatorize = Geo::Coder::Locatorize->n...
Let’s do this thing http://www.flickr.com/photos/vermininc my $result = $geocoder_many->geocode({ location => 'London NW1 ...
Possible response codes http://www.flickr.com/photos/vermininc 200  Success  210  Success (from cache) 401  Unable to find...
We need YOUR help <ul><li>Add support for  </li></ul><ul><ul><li>Geo::Coder::GoogleV3 (underway as we speak) </li></ul></u...
You may also enjoy: Subscribing to geocoding@openstreetmap.org
Thanks! About Nestoria blog.nestoria.co.uk @nestoria About me @freyfogle We’re hiring: http://www.lokku.com/jobs/
Questions? http://www.flickr.com/photos/calavera/65098350/
Upcoming SlideShare
Loading in …5
×

Remote Geocoding

1,622 views
1,547 views

Published on

Ed Freyfogle's talk on remote geocoding at 2010 London Perl Workshop

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,622
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Remote Geocoding

  1. 1. Remote Geocoding Ed Freyfogle London Perl Workshop, 4 Dec 2010
  2. 2. What is geocoding? Geocoding is the process of finding associated geographic coordinates (often expressed as latitude and longitude) from other geographic data, such as street addresses, or zip codes (postal codes) See also: http://www.lokku.com/lpw06_geocoding/
  3. 3. remote geocoding? http://www.flickr.com/photos/jennratonmort Magical internet elves try to answer your every geocoding whim across the miracle of HTTP
  4. 4. The problem: many remote geocoders Geo::Coder::Google Geo::Coder::Yahoo Geo::Coder::Placefinder Geo::Coder::Mapquest Geo::Cloudmade Geo::Coder::Bing Geo::Coder::OSM Geo::Coder::SimpleGeo And more …
  5. 5. the small print registration, keys rate limits usage limits http://www.flickr.com/photos/mrwilleeumm
  6. 6. But different … quality query formats response formats concepts of precision version changes http://www.flickr.com/photos/goldberg
  7. 7. Geo::Coder::Many One interface Single precision definition Intelligent caching and failover Easily set picker and filter methods, with common use cases predefined http://www.flickr.com/photos/vermininc
  8. 8. And now for some code http://www.flickr.com/photos/vermininc use Geo::Coder::Locatorize; use Geo::Coder::WhereIzIt; use Geo::Coder::Many; use Geo::Coder::Many::Util qw( country_filter ); # Create the Geo::Coder::Many object # using a 'weighted round robin' # scheduling method my $options = { cache => $cache_object, scheduler_type => 'WRR', }; my $geocoder_many = Geo::Coder::Many->new( $options );
  9. 9. … continued http://www.flickr.com/photos/vermininc # Create and add a geocoder my $Locatorize = Geo::Coder::Locatorize->new( appid => 'mY_loCat0r1Ze_iD' ); my $Locatorize_options = { geocoder => $Locatorize, daily_limit => 2500, }; $geocoder_many->add_geocoder( $Locatorize_options ); # Create and add a second geocoder my $WhereIzIt = Geo::Coder::WhereIzIt->new( apikey => 'mY_WhERiz1t_kEy' ); my $WhereIzIt_options = { geocoder => $WhereIzIt, daily_limit => 4000, }; $geocoder_many->add_geocoder( $WhereIzIt_options ); # Use a filter callback from Geo::Coder::Many::Util # we only want results from the UK # fuck you London, Ontario! $geocoder_many->set_filter_callback(country_filter('United Kingdom')); # Use a built-in picker callback $geocoder_many->set_picker_callback('max_precision');
  10. 10. Let’s do this thing http://www.flickr.com/photos/vermininc my $result = $geocoder_many->geocode({ location => 'London NW1 5LS' }); if (defined $result) { print &quot;Country: &quot;, $result->{country}, &quot;n&quot;; print &quot;Longitude: &quot;, $result->{longitude}, &quot;n&quot;; print &quot;Latitude: &quot;, $result->{latitude}, &quot;n&quot;; print &quot;Location: &quot;, $result->{location}, &quot;n&quot;; print &quot;Response code: &quot;, $result->{response_code}, &quot;n&quot;; print &quot;Address: &quot;, $result->{address}, &quot;n&quot;; print &quot;Precision: &quot;, $result->{precision}, &quot;n&quot;; print &quot;Geocoder: &quot;, $result->{geocoder}, &quot;n&quot;; } else { print &quot;Failed to geocode!n&quot;; }
  11. 11. Possible response codes http://www.flickr.com/photos/vermininc 200 Success 210 Success (from cache) 401 Unable to find location 402 All geocoder limits reached
  12. 12. We need YOUR help <ul><li>Add support for </li></ul><ul><ul><li>Geo::Coder::GoogleV3 (underway as we speak) </li></ul></ul><ul><ul><li>Navteq, Cloudmade, TomTom </li></ul></ul><ul><ul><li>OpenSpace, country specific services? </li></ul></ul><ul><li>More feedback </li></ul><ul><li>Move to github </li></ul><ul><li>More tests </li></ul>http://www.flickr.com/photos/revcyborg
  13. 13. You may also enjoy: Subscribing to geocoding@openstreetmap.org
  14. 14. Thanks! About Nestoria blog.nestoria.co.uk @nestoria About me @freyfogle We’re hiring: http://www.lokku.com/jobs/
  15. 15. Questions? http://www.flickr.com/photos/calavera/65098350/

×