NAME
Location::GeoTool - Perl extension for Geometry processing
SYNOPSIS
use Location::GeoTool;
my $oGeo = Location::GeoTool->create_coord('35.39.24.491','139.40.10.478','tokyo','gpsone');
my @mapion = $oGeo->format_mapion->array;
# => ("35/39/24.491","139/40/10.478")
my $oGeoW = $oGeo->datum_wgs84;
my @wgs84 = ($oGeoW->lat,$oGeoW->long);
# => ("35.39.36.145","139.39.58.871")
my @degree_wgs84 = $oGeoW->format_second;
# => (128376.14524...,502798.87076...)
DESCRIPTION
Constructor (create_coord)
my $obj = Location::GeoTool->create_coord($lat,$long,$datum,$format);
Creates Location::GeoTool object.
$lat : Latitude
$long : Longitude
$datum : Datum
$format : Format
Default datum and format of object are same with given to constructor. Give datum by string shown below:
WGS84 : 'wgs84'
TOKYO : 'tokyo'
Give format by string shown below:
MapionURL format (ddd/mm/ss.nnn) : 'mapion'
gpsOne format (ddd.mm.ss.nnn) : 'gpsone'
SpaceTag format (pddmmssnnn) : 'spacetag'
dddmmss.nnn·Á¼° : 'dmsn'
Degree (ddd.dddddd...) : 'degree'
Second (ssssss.sss...) : 'second'
Radian : 'radian'
Methods for getting latitude/longitude
Return the latitude/longitude value of object.
($lat,$long) = $obj->array;
or
$lat = $obj->lat;
$long = $obj->long;
Methods for changing datum/format
Create a new object which has new datum/format setting.
$newobj = $obj->datum_wgs84;
$newobj = $obj->format_mapion;
($lat,$long) = $obj->datum_tokyo->format_radian->array;
etc.
All methods belong to this category are shown below:
Change to wgs84 datum : datum_wgs84
Change to tokyo datum : datum_tokyo
Change to MapionURL format : format_mapion
Change to gpsOne format : format_gpsone
Change to SpaceTag format : format_spacetag
Change to dddmmss.nnn : format_dmsn
Change to degree : format_degree
Change to second : format_second
Change to radian : format_radian
Methods for create Location::GeoTool::Direction object
Create a object of Location::GeoTool::Direction, which is handling direction/distance data. Parent object is automatically set to Start-point of Location::GeoTool::Direction object.
my $dirobj = $locobj->direction_point('40/36/14.307','141/01/33.022','tokyo','mapion');
my ($dir,$dist) = ($dirobj->direction,$dirobj->distance);
or
my $direction = $locobj->direction_point($another_locobj)->direction;
or
my ($endlat,$endlong) = $locobj->direction_vector($dir,$dist)->to_point->array;
etc.
direction_point
Create Location::GeoTool::Direction object by giving End-point.
You can specify End-point by two-ways shown below:
$locobj->direction_point($lat,$long,$datum,$format);
or
$locobj->direction_point($another_locobj);
#$another_locobj is another Location::GeoTool object
direction_vector
Create Location::GeoTool::Direction object by giving direction and distance.
$locobj->direction_point($direction,$distance);
Direction is given 0-360 degree, start from north, and east is positive. Unit of distance is [m].
Create Location::GeoTool::Direction object by giving End-point.
DEPENDENCIES
Math::Trig
SEE ALSO
dir_dist2point, dir_dist2point function is based on javascript program could be seen in http://williams.best.vwh.net/gccalc.htm
datumchange and molodensly function is based on perl program could be seen in http://member.nifty.ne.jp/Nowral/02_DATUM/Molodensky.html
Thanks for these site.
Support this module in Kokogiko web site : http://kokogiko.net/
AUTHOR
OHTSUKA Ko-hei, <kotsuka@spacetag.jp>
COPYRIGHT AND LICENSE
Copyright (C) 2003,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.1 or, at your option, any later version of Perl 5 you may have available.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 746:
Non-ASCII character seen before =encoding in 'dddmmss.nnn·Á¼°'. Assuming CP1252