get country name from lat/long position
| Project: | GeoRSS module |
| Version: | HEAD |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | won't fix |
Jump to:
Hey dan,
Is there any chance that you can build in a location country check to extrapolate a country name from the lat/long points - with any location where lat/long falls in sea area, etc to get tagged as not in list?
I don't know how easy this would be to build in - maybe to query the location against a world shapefile? Or if it could be done by using the geonames webservices they are utilising in that location patch?
The georss features are ace and this would just top them off, as otherwise you are still having to go in and manually reference the country name.
Let me know if this is something you think would be useful for the module as a whole or if this would be more of a paid customisation piece.
Anyone else out there think this would be useful?
Cheers
Lucy

#1
I do this this would be a great thing to have in the module, and I think I'd do it using the geonames lookup service. If I can tie it into the geonames work that's going on in the location module (which reminds me, I want to spend some time looking at that) then so much better.
I'm moving this to HEAD as it's a feature request but I'd almost certainly backport it to 4.7 anyway.
#2
Thinking about this one, I wonder if it's better to put this into location module, so for any node that has had coordinates assigned (which would include clicking on the gmap) look it up in geonames and add that data to the node if it doesn't already have country information. What do you think?
#3
yeah i thinks that's a brilliant idea - and would then allow geocataloguing of more site content, which would be really useful for a lot of users. More people are requesting geolocating - you only need to have a look at that thread in the location module for the geonames feature - and more and more users are demanding it!
#4
The GeoNames API is to be properly released soon, but in the mean time you can get it at http://geonames.edesign.no/. It's for 5.0 but might very well work for HEAD, I have not tested it.
Use $result = geonames_query('countrycode', array(latitude,longitude));
the result object will contain what you guys need ;)
#5
Excellent, I didn't realise there was a GeoNames API module being built. Are you working with the guys developing the new Geo module too?
#6
I didn't know of any new Geo module ;). I need this for a project I'm working on, and realized at some point that I should do the work properly... I've done quite a bit work the last days as well, so the module is now close-to finished -- some code examples, and proper documentation and the latest version is now available on http://geonames.edesign.no.
I will convert it to HEAD as soon as it is released here and a few guys have tested it. Enjoy!
#7
As of the Drupal 6 release, the GeoRSS module no longer parses incoming data