I would love to see geocoding for Canada using http://geocoder.ca/

CommentFileSizeAuthor
#3 geocoder.ca_.patch1.57 KBdgrant
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ZoeN’s picture

dgrant’s picture

This cannot be hard...would be a great way for me to help out with drupal development and get my hands dirty.

All it needs to do is make a GET call like this: http://geocoder.ca/?locate=2500%20macdonald%20st.,%20vancouver,%20bc&geoit=XML and then parse the XML that looks like this:

<geodata>
<latt>49.264218</latt>
<longt>-123.168401</longt>
</geodata>

Do I just have to write a "location_geocode_ca_geocoder" function? or do I need to touch some other functions?

Dave

dgrant’s picture

Status: Active » Needs review
FileSize
1.57 KB

Here's a patch so we have some Canadian geocoding now. It works great too!

ankur’s picture

Status: Needs review » Fixed

Committed to DRUPAL-5. I went ahead and also added support for Google Maps geocoding for Canadian addresses as well. As it is now, the current patch for GeoCoder.ca has terms of service that require it for use only by not-for-profit entities that give them attribution (see the 'Terms Of Service' link in the 'Geocoding Options' for Canada for the location modue settings page).

When I get time (or if anyone else does before me), I'd like to add a settings page for GeoCoder.ca where the user can input the API key they get when they signup for the commercial service which, for a price, doesn't require attribution or non-profit use. The code would work in such a way where it would only use the key if one existed.

-Ankur

dgrant’s picture

Thanks for the fast commit. I did notice the attribution thing. Anything else we can do to help/force users to pay attention to the ToS? Like after they enable it display one of those standard drupal error/warning messages in a box at the top of the page that dumps a summary of the ToS?

Thanks for adding Google Canadian geocoding as well. There was some of that going on in the GMap module in 4.7 but with the 5.x version of GMap and Location modules I couldn't do that anymore. Maybe you guys worked together to remove some of the overlap in functionality between the 2 modules or something?

What you are proposing as far as geocoder.ca settings seems simple enough, but I'm non-profit so I don't need it. Hopefully someone with a real need to have their API key handled can code it up.

Anonymous’s picture

Status: Fixed » Closed (fixed)