The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

URI::geo - URI that contains a geographic location

SYNOPSIS

  use URI;

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

DESCRIPTION

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;

$uri->is_valid()

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.

SEE ALSO

URI

AUTHOR / COPYRIGHT / LICENSE

  Copyright (c) 2008-2009 Bjoern Hoehrmann <bjoern@hoehrmann.de>.
  This module is licensed under the same terms as Perl itself.