View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Björn Höhrmann > URI-geo > URI::geo



Annotate this POD (1)


Open  0
View/Report Bugs
Module Version: 1.00   Source  


URI::geo - URI that contains a geographic location


  use URI;

  $u = URI->new('geo:');
  $u->latlng(13.4125, 103.8667);
  print "$u\n";


The URI::geo class supports URI objects belonging to the geo URI scheme. The data URI scheme is specified in RFC 5879. It allows the identification of a physical location in a two- or three-dimensional coordinate reference system. The default reference system is the World Geodetic System 1984 (WGS-84).

URI objects belonging to the geo scheme support the common methods (described in URI) and the following scheme-specific methods:

$uri->latlng( [$new_latitude, $new_longitude] )

Sets or gets the latitude and longitude measured in decimal degrees in the default reference system.

$uri->altitude( [$new_altitude] )

Sets or gets the altitude measured in meters in the default reference system. Passing undef removes the value;

$uri->uncertainty( [$new_uncertainty] )

Sets or gets the location uncertainty parameter that indicates the amount of uncertainty in the location measured in meters. Passing undef removes the value.

$uri->crs( [$new_crs] )

Sets or gets the coordinate reference system for the coordinates in the URI. If no reference system is specified, then the default value "wgs84" is returned. Passing undef removes the value;

$uri->parameters( [$name => $value, ...] )

Sets or gets extension parameters; undef represents absent values. Passing undef removes all parameters;


Returns true if and only if the URI matches the grammar in RFC 5879. This is not a complete validity check, for example, requirements that are specific to a reference system are not checked, but can be useful when handling potentially invalid URIs as, for instance, accessors like latlng do not ensure the values returned are proper numbers.




  Copyright (c) 2008-2009 Bjoern Hoehrmann <>.
  This module is licensed under the same terms as Perl itself.
syntax highlighting: