Location integration

Summit - December 30, 2008 - 16:20
Project:GeoNames
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)
Description

Hi,

I use location/gmap for my nodes.
I use nodes which have lat/lon but sometimes the region or city is not correctly inserted.
Could integration of geonames with location be used for reverse geocoding from lat/lon to city/region/country?

Thanks a lot in advance for your answer!
Greetings,
Martijn

#1

bdragon - January 14, 2009 - 18:44

Integration would be nice.

(subscribing)

#2

lyricnz - September 14, 2009 - 15:09
Status:active» postponed (maintainer needs more info)

You can always lookup country/subdivison using code like:

<?php
   
// Lookup Tyrol, AT by lat/long
   
$results = geonames_query('countrysubdivision', array('lat' => 47.03, 'lng' => 10.2));
?>

and get results like

[15-Sep-2009 00:58:33] stdClass Object
(
    [standalone] => no
    [results] => Array
        (
            [0] => Array
                (
                    [countrycode] => AT
                    [countryname] => Austria
                    [admincode1] => 07
                    [adminname1] => Tyrol
                    [type] => ISO3166-2
                )

        )

    [total_results_count] => 1
    [service] => countrysubdivision
    [request] => Array
        (
            [url] => http://ws.geonames.org/countrySubdivision?lng=10.2&lat=47.03
            [bytes] => 334
            [seconds] => 0.745896100998
        )

    [query] => Array
        (
            [lng] => 10.2
            [lat] => 47.03
        )

)

How's that? Call the function above, and add information directly to your Location.

 
 

Drupal is a registered trademark of Dries Buytaert.