Package pygeodesy :: Module geohash :: Class Geohashed
[frames] | no frames]

Class Geohashed

object --+
         |
        Geohashed

A cache of en- and decoded geohashes of one precision.

Instance Methods
 
__init__(self, precision, ndigits=None)
New Geohashed cache.
 
__len__(self)
Return the number of unigue geohashes (int).
 
clear(self)
Clear the en- and decoded cache.
 
decoded(self, geohash, encoded=False)
Get and cache the (lat, lon) for geohash, see decode.
 
encoded(self, lat, lon, decoded=False)
Get and cache the geohash for (lat, lon), see encode.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties
  len2
  ndigits
  precision

Inherited from object: __class__

Method Details

__init__ (self, precision, ndigits=None)
(Constructor)

 

New Geohashed cache.

Arguments:
  • precision - The geohash encoded length (int, 1..12).
  • ndigits - Optional number of digits to round lat and lon to cache keys (int, typically ndigits=precision) or None for no rounding.
Overrides: object.__init__

decoded (self, geohash, encoded=False)

 

Get and cache the (lat, lon) for geohash, see decode.

Arguments:
  • encoded - If True, cache the result as encoded.
Returns:
The (lat, lon) pair for geohash.

encoded (self, lat, lon, decoded=False)

 

Get and cache the geohash for (lat, lon), see encode.

Arguments:
  • decoded - If True, cache the result as decoded.
Returns:
The geohash for pair (lat, lon).

Property Details

len2

Get method:
len2(self) - Return 2-tuple (lencoded, ldecoded) with the lengths of the en- and decoded cache.
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

ndigits

Get method:
_fget(inst) - Get and cache/memoize the property value.
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

precision

Get method:
_fget(inst) - Get and cache/memoize the property value.
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.