Geo::Coder::Ja - geocoder.ja library module for Perl
use Geo::Coder::Ja; my $geocoder = Geo::Coder::Ja->new( dbpath => '/usr/local/share/geocoderja', # required load_level => DB_AUTO, # optional. default DB_AUTO encoding => 'UTF-8', # optional. default 'SHIFT_JIS' ); # same as $geocoder->geocode($location); my $location = $geocoder->geocode(location => $location); # $location->{latitude} # $location->{longitude} # $location->{address} # $location->{address_kana}
This module is an interface for geocoder.ja library. It is available at: http://www.postlbs.org/postlbs-cms/ja/geocoder
It should be called with following arguments (items with default value are optional)
dbpath => geocoder.ja's database files directory load_level => load level. must be DB_AUTO, DB_JUKYO, DB_GAIKU, DB_AZA, DB_CHO or DB_GYOSEI. encoding => default 'SHIFT_JIS'. must be 'UTF-8', 'EUC-JP' or 'SHIFT_JIS'.
Returns an instance of this module.
geocode(location => $location) or geocode(postcode => $postcode) are supported.
Get latitude/longitude from the address or postcode.
Returns a hashref, contains the following fields:
latitude longitude address address_kana
Returns undef if multiple candidates or failure.
Set/get encoding. $encoding must be 'UTF-8', 'EUC-JP' or 'SHIFT_JIS'.
Jiro Nishiguchi <jiro@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
http://www.postlbs.org/postlbs-cms/ja/geocoder
To install Geo::Coder::Ja, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Geo::Coder::Ja
CPAN shell
perl -MCPAN -e shell install Geo::Coder::Ja
For more information on module installation, please visit the detailed CPAN module installation guide.