Geo::Coordinates::Parser - A coordinate parser class.
use Geo::Coordinates::Parser; my $coordinateparser = Geo::Coordinates::Parser->new('.'); my $decimaldegree = $coordinateparser->parse(q{E25°42'60"}); $decimaldegree = $coordinateparser->parse(q{E25.12346"});
This module provides a method for parsing a coordinate string.
This module provides the following methods:
Returns a new Geo::Coordinates::Parser object. The decimal delimiter can be given as an argument. If no argument is given then period "." character is used as decimal delimiter.
Usage:
my $coordinateparser = Geo::Coordinates::Parser->new(); # or my $coordinateparser = Geo::Coordinates::Parser->new('.'); # same as above, or my $coordinateparser = Geo::Coordinates::Parser->new(','); # , is the decimal delimiter
Parses the coordinate string and returns it's decimal value. It uses Geo::Coordinates::DecimalDegrees to turn degrees, minutes and seconds into the equivalent decimal degree. The argument can be either a longitude or a latitude. It doesn't test the sanity of the data. The method simply removes all unnecessary characters and then converts the degrees, minutes and seconds to a decimal degree.
my $decimal = $coordinateparser->parse('E25'42'60');
Returns the decimal delimiter. If an argument is given then it's sets the delimiter to the given value.
$coordinateparser->decimal_delimiter; # Returns the delimiter $coordinateparser->decimal_delimiter(','); # Sets and returns , as the delimiter $coordinateparser->decimal_delimiter; # Returns now , as the delimiter
Geo::Coordinates::DecimalDegrees
Carl Räihä, <carl.raiha at gmail.com>
Copyright 2005 by Carl Räihä / Frantic Media
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in '$coordinateparser->parse(q{E25°42'60"});'. Assuming CP1252
To install Geo::Coordinates::Parser, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Geo::Coordinates::Parser
CPAN shell
perl -MCPAN -e shell install Geo::Coordinates::Parser
For more information on module installation, please visit the detailed CPAN module installation guide.