Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Perl Modules

    WWW::Gazetteer::Getty 0.11

    Download button

    No screenshots available
    Downloads: 327  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Leon Brocard | More programs
    Perl Artistic License / FREE
    September 23rd, 2009, 19:27 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    WWW::Gazetteer::Getty description

    Find location of world towns and cities

    A gazetteer is a geographical dictionary (as at the back of an atlas). The WWW::Gazetteer::Getty module uses the information at http://www.getty.edu/research/conducting_research/vocabularies/tgn/ to return geographical location (longitude, latitude) for towns and cities in countries in the world.

    WWW::Gazetteer::Getty is a subclass of WWW::Gazetteer, so you must use that to create a WWW::Gazetteer::Getty object. Once you have imported the module and created a gazetteer object, calling find($country => $town) will return a list of hashrefs with longitude and latitude information.

     my @londons = $g->find('London', 'UK');
     my $london = $londons[0];
     print $london->{longitude}, ", ", $london->{latitude}, "
    ";
     # prints -0.1167, 51.5000

    The hashref for London actually looks like this:

     $london = {
     longitude => "-0.167",
     latitude => "51.500",
     city => 'London',
     country => 'United Kingdom',
     };

    The city and country values are the same as the ones you used. The longitude and latitude are in degrees, ranging from -180 to 180 where (0, 0) is on the Prime Meridian and the equator.

    SYNOPSYS

     use WWW::Gazetteer;
     my $g = WWW::Gazetteer::Getty->new('getty');
     my @londons = $g->find('London', 'UK');
     my $london = $londons[0];
     print $london->{longitude}, ", ", $london->{latitude}, "
    ";
     my $nice = $g->find("Nice", "France")->[0];
     print $nice->{city}, ", ", $nice->{elevation}, "
    ";



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    location finder | Perl module | WWW::Gazetteer object | WWW::Gazetteer | getty | locator

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM