Geo::Formatter

Encode / decode latitude & longitude in degree to / from other format
Download

Geo::Formatter Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • OHTSUKA Ko-hei
  • Publisher web site:
  • http://search.cpan.org/~kokogiko/

Geo::Formatter Tags


Geo::Formatter Description

Encode / decode latitude & longitude in degree to / from other format Geo::Formatter is a Perl module to encode/decode latitude & longitude in degree to/from other format.SYNOPSIS use Geo::Formatter; # Export 3 functions, latlng2format, format2latlng, and alias_format. # Encode: # Degree format with 6 digits under the decimal point. my ($lat,$lng) = latlng2format("degree",35,135); # 35.000000, 135.000000 # Signed degree format with 4 digits under the decimal point. my ($lat,$lng) = latlng2format("degree",35,135,{sign => 1,under_decimal => 4}); # +35.0000, +135.0000 # Dms format with 3 digits under the decimal point in second part. my ($lat,$lng) = latlng2format("dms",35,135); # 35.0.0.000, 135.0.0.000 # Dms format with zerofill and 0 digits under the decimal point in second part. my ($lat,$lng) = latlng2format("dms",35,135,{zerofill => 1,under_decimal => 0}); # 35.00.00, 135.00.00 # Signed dms format with "/" as devider. my ($lat,$lng) = latlng2format("dms",35,135,{devider => "/",sign => 1}); # +35/0/0.000, +135/0/0.000 # Decode: # Dms format. my ($lat,$lng) = format2latlng("dms","35.0.0.000","135.0.0.000"); # 35, 135 # Dms format with "/" as devider. my ($lat,$lng) = format2latlng("dms","+35/00/00.000","+135/00/00.000",{devider => "/"}); # 35, 135 # Alias: # You can alias any format to other name with default option alias_format("degree8","degree",{encode =>{under_decimal => 8}}); my ($lat,$lng) = latlng2format("degree8",35,135); # 35.00000000, 135.00000000 alias_format("dms2","dms",{encode =>{devider=>"/",zerofill=>1},decode =>{devider=>"/"}}); my ($lat,$lng) = latlng2format("dms2",35,135); # 35/00/00.000, 135/00/00.000 my ($lat,$lng) = format2latlng("dms2","35/00/00.000","135/00/00.000"); # 35, 135This module provides framework of encoding/decoding latlong in degree to/from other format. Default module provide only degree and dms formats, but you can extend other formats with Geo::Formatter::Format::XXX type modules. Requirements: · Perl


Geo::Formatter Related Software