Geokit issues

Yesterday while debugging an issue on our main app, I discovered that Geocoder.ca always returned a successful response when geocoding a postal code (yes, we geocode with that only). The successful response came back only with longitude and latitude values, that means, that city, province and country was nil and saved like that on our database.

Geocoder.ca geocoding. url: http://geocoder.ca/?locate=M6K0A5&auth=XXX&standard=1&showpostal=1&geoit=xml&strict=1
Geocoder.ca geocoding. Address: M6K0A5. Result: < ?xml version=”1.0″ encoding=”UTF-8″ ?>
<geodata>
<latt>43.642313</latt>
<longt>-79.429571</longt>
<postal>M6K0A5</postal>
<standard>
<stnumber>1</stnumber><staddress></staddress><city></city><prov></prov></standard>
<remaining_credits>XXX</remaining_credits>
</geodata>

 

So, if you ware going to trust Geocoder.ca with your geocoding needs, be sure to do that check before saving the returned values in your database. GoogleGeocoder at least gives you an unsuccessful response…but we all know it is not as precise as Geocoder.ca

 

Google geocoding. Address: M6K0A5. Result: < ?xml version=”1.0″ encoding=”UTF-8″ ?>
<kml xmlns=”http://earth.google.com/kml/2.0″><response>
<name>M6K0A5</name>
<status>
<code>602</code>
<request>geocode</request>
</status>
</response></kml>
Google was unable to geocode address: M6K0A5

 

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

This entry was posted in Ruby on Rails. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

You must be logged in to post a comment.