pygeodesy.geohash.Geohashed

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 Return 2-tuple `(lencoded, ldecoded)` with the `len`gths of the `en-` and `decoded` cache.
| ndigits Get the rounding (`int` or `None`).
| precision Get the `precision` (`int`).
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 Return 2-tuple `(lencoded, ldecoded)` with the `len`gths of the `en-` and `decoded` cache. Get method: len2(self) - Return 2-tuple `(lencoded, ldecoded)` with the `len`gths 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 the rounding (`int` or `None`). Get method: ndigits(self) - Get the rounding (`int` or `None`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### precision Get the `precision` (`int`). Get method: precision(self) - Get the `precision` (`int`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.