Geocoding the World in Perl YAPC::EU 2014

Post on 11-Jan-2015

336 views 0 download

description

Yet another introduction to the challenges of geocoding and the ways we approach those problems at Lokku/Nestoria. I describe the details of how we tackle geocoding in countries like India, and also plug our the new OpenCage Data Geocoder API.

Transcript of Geocoding the World in Perl YAPC::EU 2014

Geocoding the World(in Perl)

Alex Balhatchet @ YAPC::EU 2014, София България

What is Geocoding?

What is Geocoding?

147Tsarigradsko shose blvd1784SofiaBulgaria

Geocoder

42.649996

23.394527

Geocoding at Nestoria

Geocoding at Nestoria

Property Listing(XML)

Geocoder(Perl!)

Results(Percona)

UK - so beautiful...<location>

<full_address>Wold View, Caistor LN7</full_address>

<postcode>LN7 6UU</postcode>

<latitude>53.496356</latitude>

<longitude>-0.312442</longitude>

<coordinate_system>WGS84</coordinate_system>

<coordinate_confidence unit="gmaps">5</coordinate_confidence>

<placenames>

<street number="4">Wold View</street>

<town>Caistor, Market Rasen</town>

</placenames>

</location>

UK Postcodes are insane<postcode>LN7 6UU</postcode>

Germany - still quite good

<geo>

<strasse>Fischbeker Weg 12</strasse>

<ort>Bargteheide</ort>

<bundesland>Schleswig-Holstein</bundesland>

<plz>22941</plz>

</geo>

France - surprisingly bad data

<location>

<postcode>47000</postcode>

<placenames>

<town></town>

<region>Aquitaine</region>

</placenames>

</location>

India - nightmare mode unlocked<location>

<full_address>Hiland Landmark,Jangamakote, Vijayapura, Devanahalli, Bangalore, Karnataka, INDIA.</full_address>

<latitude>13.280192></latitude>

<longitude>77.848219</longitude>

<placenames>

<building>Hiland Landmark</building>

<area>Devanahalli</area>

<town>Bangalore</town>

<province>jangamakote</province>

</placenames>

</location>

India - nightmare mode unlocked

The SolutionThe Nestoria Geocoder

Geodata

+ our own “amendments”

Nestoria Geocoder Internals

Nestoria Geocoder Internals

Nestoria Geocoder Internals

Nestoria Geocoder Internals

Nestoria Geocoder Internals

Nestoria Geocoder Internals

Nestoria Geocoder Internals

Nestoria Geocoder Internals

Nestoria Geocoder Internals

Nestoria Geocoder Internals

External Geocoders

■ https://metacpan.org/search?q=Geo::Coder

■ Lots available!

■ Mostly very low daily usage limits (1000s per day)

■ We wrote Geo::Coder::Many to help multiplex between them within usage limits

The Bad News

The Good News

OpenCage Geocoder API

■ http://geocoder.opencagedata.com/

■ Geo::Coder::OpenCage

■ Currently free

■ Will always have a free tier

OpenCage Geocoder API

■ It’s new!

■ Please try it out and give us your feedback

■ @opencagedata

■ geocoder.opencagedata.com/contact.html

Thanks / Questions