NAME

Location::Area::DoCoMo::iArea - Get NTT DoCoMo's i-Area from i-Area code or Geo coordinate

SYNOPSIS

use Location::Area::DoCoMo::iArea;

#Create object

# Get i-Area object from Geo coordinate at WGS84 Datum
$oiArea = Location::Area::DoCoMo::iArea->setCoordinate("+0342039933","+1352151826");
# or at TOKYO Datum
$oiArea = Location::Area::DoCoMo::iArea->setCoordinate("+0342039933","+1352151826",1);

# Get i-Area object from full area code
$oiArea = Location::Area::DoCoMo::iArea->setArea("152","00");
# or same
$oiArea = Location::Area::DoCoMo::iArea->setArea("15200");

#Get data

# Get full area code (5digit)
my $fid = $oiArea->full_areaid();
# Get main area code (3digit)
my $pid = $oiArea->areaid();
# Get sub area code (2digit)
my $sid = $oiArea->sub_areaid();

# Get area name (at EUC-JP character code)
my $name = $oiArea->name();
# Get prefecture name of this area (at EUC-JP character code)
my $pref = $oiArea->prefecture();
# Get region name of this area (at EUC-JP character code)
my $reg = $oiArea->region();

# Get south, west, north, east limit of this area at WGS84 Datum
my ($slim,$wlim,$nlim,$elim) = $oiArea->getAura();
# Or at TOKYO Datum
my ($slim,$wlim,$nlim,$elim) = $oiArea->getAura(1);
# Get i-Area object list which are next to this area
my @next = $oiArea->getNextArea();

DESCRIPTION

EXPORT

None

CONSTRUCTOR

setCoordinate

Create i-Area object from coordinate.
Coordinate format is pdddmmssnnn.
(p: plus/minus, d:degree, m:minute, s:second n: millisecond)
Default datum is WGS84, but you can use TOKYO if you set $utokyo argument as 1.

Usage:
  $obj = Location::Area::DoCoMo::iArea->setCoordinate($lat,$lon,$utokyo);
Arguments:
  $lat   : Latitude (North are Positive).
  $lon   : Longitude (East are Positive).
  $utokyo: Set 1 if you want to use TOKYO datum.
Return Values:
  $obj   : Location::Area::DoCoMo::iArea object. undef if can't bind coprdinate to area.

setArea

Create i-Area object from full area code.

Usage:
  $obj = Location::Area::DoCoMo::iArea->setArea($id,$sid);
Arguments:
  $id    : Set full area code or main area code
  $lon   : Set sub area code (needed if you give main area code as $id)
Return Values:
  $obj   : Location::Area::DoCoMo::iArea object. undef if can't bind code to area.

METHOD

full_areaid

areaid

sub_areaid

Each method returns full area code, main area code or sub area code.

name

prefecture

region

Each method returns area name, prefecture name of this area or region name of this area.
Each return values are described in EUC-JP character code.

getAura

Get south, west, north, east limit of this area.
Method returns WGS84 datum in default, but you can get TOKYO if you set $utokyo argument as 1.

Usage:
  ($slim,$wlim,$nlim,$elim) = $obj->getAura($utokyo);
Arguments:
  $utokyo: Set 1 if you want to use TOKYO datum.
Return Values:
  $slim  : South limit latitude of this area.
  $wlim  : West limit longitude of this area.
  $nlim  : South limit latitude of this area.
  $elim  : East limit longitude of this area.
Notice:
  NTT DoCoMo provides limit data of all sides in each area at TOKYO datum.
  In WGS84, this function convert two points ($slim,$wlim),($nlim,$elim)
  from TOKYO.
  But, converting from TOKYO to WGS84 is not a linear, so this data may cause inconsistency if you use it in a strict sense.

getNextArea

Get i-Area object list which are next to this area.

Usage:
  @next = $obj->getNextArea();
Return Values:
  $slim  : i-Area object list of areas next to this area.
Notice:
  If there is the sea between one area and another, they are not next area.
  This definition is based on NTT DoCoMo's.

DEPENDENCIES

DBI
DBD::SQLite
Carp
File::Basename
Cwd
Location::GeoTool

SEE ALSO

i-Area data in this version is based on NTT DoCoMo's data, publicated in May 15th, 2003.
You can get original data on 
http://www.nttdocomo.co.jp/p_s/imode/iarea/iareadata030512.lzh.
And, next area data is based on NTT DoCoMo's web site,
http://www.nttdocomo.co.jp/p_s/imode/iarea/iareaweb/iarea_contents.html.
You should see these site.

Support this module in SpaceTag Inc. web site : http://www.spacetag.jp/

AUTHOR

OHTSUKA Ko-hei, <kotsuka@spacetag.jp>

COPYRIGHT AND LICENSE

Copyright (C) 2004 by SpaceTag INC.,

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.