The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

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

SYNOPSIS

  use Location::Area::DoCoMo::iArea;
  # Or, if you want to use adjusted Aura data,
  use Location::Area::DoCoMo::iArea qw(useAdjustedAura);

  #Create object

  # Get i-Area object from Geo coordinate at WGS84 Datum
  $oiArea = Location::Area::DoCoMo::iArea->create_coord("34/20/39.933","135/21/51.826","tokyo","mapion");
  # or 
  $oiArea = Location::Area::DoCoMo::iArea->create_coord("342039.933","1352151.826","wgs84","dmsn");

  # Get i-Area object from full area code
  $oiArea = Location::Area::DoCoMo::iArea->create_iarea("152","00");
  # or same
  $oiArea = Location::Area::DoCoMo::iArea->create_iarea("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 aura (boundary square of area) object (Location::GeoTool::Aura)
  my $oAura = $oiArea->get_aura;
  # Get south, west, north, east limit of this area at WGS84 datum, gpsOne format
  my ($slim,$wlim,$nlim,$elim) = $oAura->datum_wgs84->format_gpsone->array;
  # Or at TOKYO datum, degree
  my ($slim,$wlim,$nlim,$elim) = $oAura->datum_tokyo->format_degree->array;

  # Get Aura's center point object (Location::GeoTool)
  my ($clat,$clong) = $oiArea->get_center->array;

DESCRIPTION

CONSTRUCTOR

create_coord

Create Location::Area::DoCoMo::iArea object from coordinate.

  Usage:
    $obj = Location::Area::DoCoMo::iArea->create_coord($lat,$lon,$datum,$format);
  Arguments:
    $lat   : Latitude (North are Positive).
    $lon   : Longitude (East are Positive).
    $datum : Specify datum of $lat/$long. (See Location::GeoTool)
    $format: Specify format of $lat/$long. (See Location::GeoTool)

  or another way,

  Usage:
    $obj = Location::Area::DoCoMo::iArea->create_coord($point);
  Arguments:
    $point : Object of Location::GeoTool.

  Return Values:
    $obj   : Location::Area::DoCoMo::iArea object. undef if can't bind coordinate to area.

create_iarea

Create Location::Area::DoCoMo::iArea object from full area code.

  Usage:
    $obj = Location::Area::DoCoMo::iArea->create_iarea($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.

FIELDS

full_areaid

areaid

sub_areaid

Each fields return full area code, main area code or sub area code.

name

prefecture

region

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

METHODS

include_area

Check the point is included current area or not.

  Usage:
    $is_include = $obj->include_area($lat,$lon,$datum,$format);
    # or
    $is_include = $obj->include_area($point);

  Return Values:
    $is_include : Return 1 if included, 0 if not.

get_aura

Get aura (boundary square of area) object - Location::GeoTool::Aura.

  Usage:
    $oAura = $obj->get_aura;

The way to use Location::GeoTool::Aura object is like below:

 #Specify datum or format:
   $oAura->datum_wgs84->format_degree...
  Names of methods are same with Location::GeoTool.

 #Get boundary latitude/longitude array:
   ($sbound,$wbound,$nbound,$ebound) = $oAura->......->array;

  Notice:
    NTT DoCoMo's aura data contains a lot of inconsistencies.
    There are differents between Aura boundary square, which is
    defined by DoCoMo's summary data, and that is calcurated
    from mesh data.

    So, I add adjusted aura data which are calcurated from mesh,
    you can use it.
    If you want, you should use this module like this:
     
     use Location::Area::DoCoMo::iArea qw(useAdjustedAura);
    

get_center

Get aura's center point by Location::GeoTool object.

  Usage:
    $cpoint = $obj->get_center;

To get coordinate of center point, like below:

   ($clat,$clong) = $cpoint->datum_wgs84->format_degree->array;

get_nextarea

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

  Usage:
    @next = $obj->getNextArea;
  Return Values:
    @next  : i-Area object list of areas next to this area.
  Notice:
   1.If there is the sea between one area and another, they are not next area.
     This definition is based on NTT DoCoMo's.
   2.DoCoMo's official data contains a lot of inconsistencies.
     So, this module adjusts them.

DEPENDENCIES

 Carp
 Location::GeoTool

SEE ALSO

 i-Area data in this version is based on NTT DoCoMo's data, publicated in Mar. 29th, 2004.
 You can get original data on 
 http://www.nttdocomo.co.jp/p_s/imode/iarea/iareadata040329.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 Kokogiko! web site : http://kokogiko.net/

AUTHOR

OHTSUKA Ko-hei, <nene@kokogiko.net>

COPYRIGHT AND LICENSE

Copyright (C) 2004-2007 by Kokogiko!, And, latest data updating is based on Mr. Kunihiko Miyanaga(ideaman's Inc. http://www.ideamans.com/)'s work. Thank you!

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.