Giter Club home page Giter Club logo

geo-coder-google's Introduction

NAME
    Geo::Coder::Google - Google Maps Geocoding API

SYNOPSIS
      use Geo::Coder::Google;

      my $geocoder = Geo::Coder::Google->new(apikey => 'Your API Key');
      my $location = $geocoder->geocode( location => 'Hollywood and Highland, Los Angeles, CA' );

DESCRIPTION
    Geo::Coder::Google provides a geocoding functionality using Google Maps
    API.

METHODS
    new
          $geocoder = Geo::Coder::Google->new(apikey => 'Your API Key');
          $geocoder = Geo::Coder::Google->new(apikey => 'Your API Key', host => 'maps.google.co.jp');

        Creates a new geocoding object. You should pass a valid Google Maps
        API Key as "apikey" parameter.

        When you'd like to query Japanese address, you might want to set
        *host* parameter, which should point to *maps.google.co.jp*. I think
        this also applies to other countries like UK (maps.google.co.uk),
        but so far I only tested with *.com* and *.co.jp*.

    geocode
          $location = $geocoder->geocode(location => $location);
          @location = $geocoder->geocode(location => $location);

        Queries *$location* to Google Maps geocoding API and returns hash
        refernece returned back from API server. When you cann the method in
        an array context, it returns all the candidates got back, while it
        returns the 1st one in a scalar context.

        When you'd like to pass non-ascii string as a location, you should
        pass it as either UTF-8 bytes or Unicode flagged string.

        Returned data structure is as follows:

          {
            'AddressDetails' => {
              'Country' => {
                'AdministrativeArea' => {
                  'SubAdministrativeArea' => {
                    'SubAdministrativeAreaName' => 'San Francisco',
                    'Locality' => {
                      'PostalCode' => {
                        'PostalCodeNumber' => '94107'
                      },
                      'LocalityName' => 'San Francisco',
                      'Thoroughfare' => {
                        'ThoroughfareName' => '548 4th St'
                      }
                    }
                  },
                  'AdministrativeAreaName' => 'CA'
                },
                'CountryNameCode' => 'US'
              }
            },
            'address' => '548 4th St, San Francisco, CA 94107, USA',
            'Point' => {
              'coordinates' => [
                '-122.397323',
                '37.778993',
                0
              ]
            }
          }

AUTHOR
    Tatsuhiko Miyagawa <[email protected]>

    This library is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself.

SEE ALSO
    Geo::Coder::Yahoo,
    <http://www.google.com/apis/maps/documentation/#Geocoding_Examples>

geo-coder-google's People

Contributors

arcanez avatar miyagawa avatar autarch avatar barwin avatar dtaylor avatar maros avatar whindsx avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.