.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Geo::Coordinates::Transform 3pm" .TH Geo::Coordinates::Transform 3pm "2022-11-27" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Geo::Coordinates::Transform \- Transform Latitude/Longitude between various different coordinate functions .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Geo::Coordinates::Convert; \& \& # List of a lat/longs in various formats. \& my @lst = ( 47.9805, \-116.5586, \*(Aq47 58.8300\*(Aq, \*(Aq\-116 33.5160\*(Aq, \*(Aq47 58 49\*(Aq, \*(Aq\-116 33 30\*(Aq); \& \& my $cnv = new Geo::Coordinates::Convert(); \& \& my $out_ref = []; # Array reference \& \& # Convert List to Decimal\-Degrees... DD.DDDD \& $out_ref = $cnv\->cnv_to_dd(\e@lst); \& \& # Convert List to Degree Decimal\-Degrees... DD MM.MMMM \& $out_ref = $cnv\->cnv_to_ddm(\e@lst); \& \& # Convert List to Degrees Minutes Decimal Seconds DD MM SS.SSSS \& $out_ref = $cnv\->cnv_to_dms(\e@lst); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" There are several formats used to present geographic coordinates. For example: .PP .Vb 3 \& * DMS Degrees:Minutes:Seconds (48 30 30, \-117 30\*(Aq 30") \& * DM Degrees:Decimal\-Minutes (48 30.5, \-117 30.5\*(Aq), \& * DD Decimal\-Degrees (48.5083333, \-17.5083333) .Ve .PP This module converts a list of provided latitude and longitude coordinates in any of the three formats above (mixed input is ok) and converts to the desired format. Note that special characters or non-numerical characters such as " will throw an warning and return NaN for that list item. .PP In addition, the input does not interpert N,S,W,E designators but expects coordinates to be in positive or negative representation. .PP Format of the output can be controlled via input arguments in the constructor. The arguments are expected to be in the form of a hash reference. For example: .PP .Vb 5 \& # Change output format \& # Hash aruements are \& # \*(Aqdd_fmt\*(Aq = Decimal\-Degrees format \& # \*(Aqdm_fmt\*(Aq = Decimal\-Minutes format \& # \*(Aqds_fmt\*(Aq = Decimal\-Second format \& \& # Example \& my $cnv = new Geo::Coordinates::Convert( {dd_fmt=>\*(Aq%3.2f\*(Aq, dm_fmt=>\*(Aq%3.1f\*(Aq, ds_fmt=>\*(Aq%d\*(Aq} ); .Ve .PP Minimal sanity checks are performed. 75 minutes will be handled as 1 degree and 15 minutes. .SH "SEE ALSO" .IX Header "SEE ALSO" The Geographic Coordinate System wiki ia good place for background documentation http://en.wikipedia.org/wiki/Geographic_coordinate_system .PP A useful web interface using this module can be found here. .PP http://perlworks.com/calculate/latitude\-longitude\-conversion/ .SH "METHODS" .IX Header "METHODS" Only three methods provided. Expected input is a reference to a list and output is a reference to list. .PP .Vb 3 \& $out_ref = $cnv\->cnv_to_dd(\e@lst); # To Degree Decimal\-Degrees... DD.DDDDDDD \& $out_ref = $cnv\->cnv_to_ddm(\e@lst); # To Degree Decimal\-Minutes... DD MM.MMMM \& $out_ref = $cnv\->cnv_to_dms(\e@lst); # To Degrees Minutes Decimal Seconds DD MM SS.SSSS .Ve .SH "AUTHOR" .IX Header "AUTHOR" .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2010 by Troxel .PP 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.8 or, at your option, any later version of Perl 5 you may have available.