[ddj] Reverse Geocoding Country: Best Practice
Matthew Linares
matthewlinares at gmail.com
Wed Nov 12 10:11:36 UTC 2014
It was quite a simple IMPORTXML function in the end, where G=latitude and
H=longitude:
=IMPORTXML(CONCAT(CONCAT(CONCAT("
http://nominatim.openstreetmap.org/reverse?format=xml&lat=", G2), "&lon="),
H2),"/reversegeocode/addressparts/country_code")
I also switched APIs from Google to OSM (as above) which returned
significantly more manageable XML.
My initial question was actually to find a mapping service that did this,
which I assumed there would be, but I'm happy with this.
For posterity:
http://ask.schoolofdata.org/question/524/reverse-geocoding-countries-best-practice/
On 12 November 2014 10:50, Sam Leon <sam.leon at okfn.org> wrote:
> I'd like to know the answer to this too.
>
> Don't have time to try any of this out right now, but it does appear that
> Google Apps Scripts offer a reverse geocoding function that could be run
> within a sheet to return approximate addresses for a set of coordinates:
>
> https://developers.google.com/apps-script/reference/maps/geocoder
>
> There is also a similar question on Stack Overflow with one answer that
> might be useful:
>
> http://stackoverflow.com/questions/13869828/reverse-geocode-in-google-docs
>
>
>
> On 11 November 2014 11:47, Matthew Linares <matthewlinares at gmail.com>
> wrote:
>
>> Dear all,
>>
>> I have a table which includes latitude/longitude values but no clean
>> country location. I'm presently fiddling with the Google sheets IMPORTXML
>> method to get a plain country field:
>>
>> http://schoolofdata.org/handbook/recipes/geocoding/
>>
>> ...which is a bit untidy due to xPath selection on the resulting XML.
>>
>> Does anyone know a slicker tool or method to achieve this? I did start by
>> loading the data into mapping apps and seeing if they exported with country
>> data but nothing I found did that.
>>
>> Thanks,
>> Matt
>>
>>
>> _______________________________________________
>> data-driven-journalism mailing list
>> data-driven-journalism at lists.okfn.org
>> https://lists.okfn.org/mailman/listinfo/data-driven-journalism
>> Unsubscribe:
>> https://lists.okfn.org/mailman/options/data-driven-journalism
>>
>>
>
>
> --
>
> *Sam LeonSenior analyst & trainer | skype: samedleon | @Noel_Mas
> <https://twitter.com/noel_mas>The Open Knowledge Foundation
> <http://okfn.org/>Empowering through Open Knowledgehttp://okfn.org/
> <http://okfn.org/> | @okfn <http://twitter.com/OKFN> | OKF on Facebook
> <https://www.facebook.com/OKFNetwork> | Blog <http://blog.okfn.org/> |
> Newsletter <http://okfn.org/about/newsletter>*
>
> _______________________________________________
> data-driven-journalism mailing list
> data-driven-journalism at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/data-driven-journalism
> Unsubscribe: https://lists.okfn.org/mailman/options/data-driven-journalism
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/data-driven-journalism/attachments/20141112/20e0a34b/attachment-0003.html>
More information about the data-driven-journalism
mailing list