Your SlideShare is downloading. ×
0
Remote Geocoding
Remote Geocoding
Remote Geocoding
Remote Geocoding
Remote Geocoding
Remote Geocoding
Remote Geocoding
Remote Geocoding
Remote Geocoding
Remote Geocoding
Remote Geocoding
Remote Geocoding
Remote Geocoding
Remote Geocoding
Remote Geocoding
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Remote Geocoding

1,317

Published on

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

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,317
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Remote Geocoding Ed Freyfogle London Perl Workshop, 4 Dec 2010
  • 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. remote geocoding? http://www.flickr.com/photos/jennratonmort Magical internet elves try to answer your every geocoding whim across the miracle of HTTP
  • 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. the small print registration, keys rate limits usage limits http://www.flickr.com/photos/mrwilleeumm
  • 6. But different … quality query formats response formats concepts of precision version changes http://www.flickr.com/photos/goldberg
  • 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. 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. … 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. Let’s do this thing http://www.flickr.com/photos/vermininc my $result = $geocoder_many->geocode({ location => 'London NW1 5LS' }); if (defined $result) { print "Country: ", $result->{country}, "n"; print "Longitude: ", $result->{longitude}, "n"; print "Latitude: ", $result->{latitude}, "n"; print "Location: ", $result->{location}, "n"; print "Response code: ", $result->{response_code}, "n"; print "Address: ", $result->{address}, "n"; print "Precision: ", $result->{precision}, "n"; print "Geocoder: ", $result->{geocoder}, "n"; } else { print "Failed to geocode!n"; }
  • 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. We need YOUR help
    • Add support for
      • Geo::Coder::GoogleV3 (underway as we speak)
      • Navteq, Cloudmade, TomTom
      • OpenSpace, country specific services?
    • More feedback
    • Move to github
    • More tests
    http://www.flickr.com/photos/revcyborg
  • 13. You may also enjoy: Subscribing to geocoding@openstreetmap.org
  • 14. Thanks! About Nestoria blog.nestoria.co.uk @nestoria About me @freyfogle We’re hiring: http://www.lokku.com/jobs/
  • 15. Questions? http://www.flickr.com/photos/calavera/65098350/

×