The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Location::GeoTool - Perl extension for Geometry processing

SYNOPSIS

  use Location::GeoTool;
  
  my $ret = coordformat($coord,$farg,$targ,$pon);
  my ($tlat,$tlon) = dir_dist2point($lat,$lon,$dir,$dis,$datum);
  my ($dir,$dis) = point2dir_dist($lat,$lon,$tlat,$tlon,$datum);
  my ($tlat,$tlon) = datumchange($lat,$lon,$h,$from,$to);

DESCRIPTION

EXPORT

  coordformat
  dir_dist2point
  point2dir_dist
  datumchange

coordformat

  Change the format of coordinate.
  Standard format is pdddmmssnnn.
  (p: plus/minus, d:degree, m:minute, s:second n: micro second)

  Usage:
    $ret = coordformat($coord,$farg,$targ,$pon);
  Arguments:
    $coord : Original Formatted Coordinate
    $farg  : Original Format ID
    $targ  : Wanted Format ID
    $pon   : On/Off of plus/minus
  Return Values:
    $ret   : Wanted Formatted Coordinate
  Format ID:
    LG_FMT         : Standard Format (pdddmmssnnn)
    LG_FMT_MAPION  : Mapion URL Format (ddd/mm/ss.nnn)
    LG_FMT_DMSN    : dddmmss.nnn
    LG_FMT_SEC     : Second (ssssss.sss)
    LG_FMT_DEG     : Degree (ddd.dddddddd)
    LG_FMT_RAD     : Radian
    LG_FMT_GPSONE  : ddd.mm.ss.nnn

dir_dist2point

  Calcurate a point that has the direction and the distance from 
  other point.
  Original Version is in JavaScript,
  http://williams.best.vwh.net/gccalc.htm
  coding by Mr. Ed Williams.

  Coordinates format is : pdddmmssnnn

  Usage:
    ($tlat,$tlon) = dir_dist2point($lat,$lon,$dir,$dis,$datum);
  Arguments:
    $lat   : Latitude
    $lon   : Longitude
    $dir   : Direction (degree, North and East are Positive.)
    $dis   : Distance (m)
    $datum : LG_WGS84, LG_TOKYO
  Return Values:
    $tlat  : Latitude of calcurated position
    $tlon  : Longitude of calcurated position

point2dir_dist

  Give two points by coordinates, then calcurate distance 
  and direction of them.
  Original Version is in JavaScript,
  http://williams.best.vwh.net/gccalc.htm
  coding by Mr. Ed Williams.

  Coordinates format is : pdddmmssnnn

  Usage:
    ($dir,$dis) = point2dir_dist($lat,$lon,$tlat,$tlon,$datum);
  Arguments:
    $lat   : Latitude of From Point
    $lon   : Longitude of From Point
    $tlat  : Latitude of To Point
    $tlon  : Longitude of To Point
    $datum : LG_WGS84, LG_TOKYO
  Return Values:
    $dir   : Direction (degree, North and East are Positive.)
    $dis   : Distance (m)

datumchange

  Change the coordinate to different datum.
  Logic is based on Molodensky method. 
  Original Version is Perl CGI
  http://member.nifty.ne.jp/Nowral/02_DATUM/Molodensky.html
  coding by Nowral.

  Coordinates format is : pdddmmssnnn

  Usage:
    ($tlat,$tlon,$th) = datumchange($lat,$lon,$h,$from,$to);
  Arguments:
    $lat  : Latitude
    $lon  : Longitude
    $h¡¡  : Altitude (cm)
    $from : Original Datum
    $to   : Wanted Datum
  Return Values:
    $tlat : Latitude in wanted Datum
    $tlon : Longitude in wanted Datum
    $th¡¡ : Altitude in wanted Datum

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 SpaceTag Inc. web site : http://www.spacetag.jp/

AUTHOR

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

COPYRIGHT AND LICENSE

Copyright (C) 2003 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 479:

Non-ASCII character seen before =encoding in '$h¡¡'. Assuming CP1252