-
-
29 Feb 2008 14:42:43 UTC
- Distribution: Geo-Hash
- Module version: 0.02
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (2)
- Testers (1522 / 1 / 2)
- Kwalitee
Bus factor: 0- 91.76% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (4.73KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Test::More
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
Why not adopt me?
This distribution is up for adoption! If you're interested then please contact the PAUSE module admins via email.- NAME
- VERSION
- SYNOPSIS
- DESCRIPTION
- INTERFACE
- CONFIGURATION AND ENVIRONMENT
- DEPENDENCIES
- INCOMPATIBILITIES
- BUGS AND LIMITATIONS
- AUTHOR
- LICENCE AND COPYRIGHT
NAME
Geo::Hash - Encode / decode geohash.org locations.
VERSION
This document describes Geo::Hash version 0.02
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;
precision
Infer a suitable precision (number of character in hash) for a given lat, lon pair.
my $prec = $gh->precision( $lat, $lon );
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
precision
will be used to provide a default.decode_to_interval
Like
decode
but instead of returning a pair of coordinates returns the interval for each coordinate. This gives some indication of how precisely the original hash specified the location.The return value is a pair of array refs. Each referred to array contains the upper and lower bounds for each coordinate.
my ( $lat_range, $lon_range ) = $gh->decode_to_interval( $hash ); # $lat_range and $lon_range are references to two element arrays
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>
http://geohash.org/gcwrdtsvrfgr
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.
Module Install Instructions
To install Geo::Hash, copy and paste the appropriate command in to your terminal.
cpanm Geo::Hash
perl -MCPAN -e shell install Geo::Hash
For more information on module installation, please visit the detailed CPAN module installation guide.