NAME

Geo::Hash - Encode / decode geohash.org locations.

VERSION

This document describes Geo::Hash version 0.01

SYNOPSIS

  use Geo::Hash;

  my $gh = Geo::Hash->new;
  my $hash = $gh->encode( $lat, $lon );
  my ( $lat, $lon ) = $gh->decode( $hash );

DESCRIPTION

Geohash is a latitude/longitude geocode system invented by Gustavo Niemeyer when writing the web service at geohash.org, and put into the public domain.

This module encodes and decodes geohash locations.

See http://en.wikipedia.org/wiki/Geohash and http://geohash.org for more information.

INTERFACE

new

Create a new Geo::Hash object.

my $gh = Geo::Hash->new;

encode

Encode a lat, long pair into a geohash.

my $hash = $gh->encode( $lat, $lon );

You may optionally supply the length of the desired geohash:

# Very precise
my $hash = $gh->encode( $lat, $lon, 10 );

If the precision argument is omitted an eight character geohash will be created.

decode

Decode a geohash into a lat, long pair.

my ( $lat, $lon ) = $gh->decode( $hash );

CONFIGURATION AND ENVIRONMENT

Geo::Hash requires no configuration files or environment variables.

DEPENDENCIES

None.

INCOMPATIBILITIES

None reported.

BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests to bug-geo-hash@rt.cpan.org, or through the web interface at http://rt.cpan.org.

AUTHOR

Andy Armstrong <andy@hexten.net>

LICENCE AND COPYRIGHT

Copyright (c) 2008, Andy Armstrong <andy@hexten.net>.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.