| Geo-Coordinates-Converter documentation | Contained in the Geo-Coordinates-Converter distribution. |
Geo::Coordinates::Converter::Format - geo coordinates format converter
it undergoes plastic operation on the format of coordinates.
as for these formats, the added thing is possible.
Kazuhiro Osawa <yappo {at} shibuya {dot} pl>
Geo::Coordinates::Converter, Geo::Coordinates::Converter::Format::Dms, Geo::Coordinates::Converter::Format::Degree
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Geo-Coordinates-Converter documentation | Contained in the Geo-Coordinates-Converter distribution. |
package Geo::Coordinates::Converter::Format; use strict; use warnings; use Carp; sub name { '' } sub detect { croak 'This method is unimplemented' } sub new { my($class, $args) = @_; $args = +{} unless defined $args; bless { %{ $args } }, $class; } sub normaraiz { goto &normalize } # alias for backward compatibility sub normalize { my($self, $point) = @_; for my $meth (qw/ lat lng /) { next unless defined $point->$meth; if ($point->$meth =~ /^\+(.+)$/) { $point->$meth($1); } elsif (my($prefix, $val) = $point->$meth =~ /^([NEWS])(.+)$/i) { $prefix =~ /^[WS]$/i ? $point->$meth("-$val") : $point->$meth($val); } } } sub to { $_[1] } sub from { $_[1] } sub round { $_[1] } 1; __END__