This patch provides an optional second argument to google_geocode_location which causes the function to return an array in this form...
Array
(
[CountryNameCode] => GB
[AdministrativeAreaName] => England
[SubAdministrativeAreaName] => Greater London
[LocalityName] => Barnet
[coordinates] => -0.179890,51.562816,0
)
I personal am finding this useful as i'm importing data which contains a postcode and the address first line only. It provides a consistent list of towns and provinces.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | location-allow-return-full-geocoding-result-213387-4.patch | 2.39 KB | semiaddict |
| #2 | location_return_results.patch | 1.99 KB | nickl |
Comments
Comment #1
yesct commentedThis sounds really cool. If someone wants to create a patch to implement this, please do. Since this has been inactive for over a year, I'll mark it postponed for now, because this might be an idea worth investigating in the future.
Comment #2
nickl commentedAttached patch rolled against head.
When supplying the following details
Street address: 10 Springbok st
City: Pofadder
Country: South Africa
Traversing through the returned xml a data collection can be populated as follows.
Currently the location object is not being passed by reference and therefor the result cannot be populated back.
Any suggestions?
Comment #3
yesct commentedtagging
Comment #4
semiaddict commentedHi,
Here's a different patch that adds a second boolean argument to google_geocode_location called full_result.
The argument is set to false by default, but if set to true returns the full geocoding result returned by google.
To make it easier to do this, I changed the format from xml to json. So the full result returned will be the result of a json_decode.
---
Oussama Mubarak // Semiaddict
Comment #5
podarokall feature requests should be rolled against latest 7.x-3.x-dev and after commit can be backported to 6.x branch