Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ encoding Geohashes_ to and from latitude and longitude coordinates.
Example::

>>> import Geohash
>>> print 'Geohash for 42.6, -5.6:', Geohash.encode(42.6, -5.6)
>>> print('Geohash for 42.6, -5.6:', Geohash.encode(42.6, -5.6))
Geohash for 42.6, -5.6: ezs42e44yx96

You can specify an arbitrary precision when encoding. The precision
determines the number of characters in the Geohash::

>>> print 'Geohash for 42.6, -5.6:', Geohash.encode(42.6, -5.6, precision=5)
>>> print('Geohash for 42.6, -5.6:', Geohash.encode(42.6, -5.6, precision=5))
Geohash for 42.6, -5.6: ezs42

Decoding a Geohash returns a (latitude, longitude) tuple::

>>> print 'Coordinate for Geohash ezs42:', Geohash.decode('ezs42')
>>> print('Coordinate for Geohash ezs42:', Geohash.decode('ezs42'))
Coordinate for Geohash ezs42: ('42.6', '-5.6')

The Geohash module also provides exact decoding with error margin
results. The decode_exactly function returns a tuple of four float
values; latitude, longitude, latitude error margin, longitude error
margin::

>>> print 'Exact coordinate for Geohash ezs42:\n', Geohash.decode_exactly('ezs42')
>>> print('Exact coordinate for Geohash ezs42:\n', Geohash.decode_exactly('ezs42'))
Exact coordinate for Geohash ezs42:
(42.60498046875, -5.60302734375, 0.02197265625, 0.02197265625)

Expand Down