Home | Trees | Indices | Help |
|
---|
|
Class Geohash and several functions to encode, decode and inspect geohashes.
Transcribed from JavaScript originals by (C) Chris Veness 2011-2015 and published under the same MIT Licence**.
More details at http://www.movable-type.co.uk/scripts/geohash.html. See also http://github.com/vinsci/geohash, http://github.com/davetroy/geohash-js and http://pypi.python.org/pypi/pygeohash.
Version: 17.06.04
Classes | |
Geohash Geohash class, sub-class of str. |
Functions | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Function Details |
Returns the SW and NE lat-/longitude bounds of a geohash.
Example: >>> geohash.bounds('u120fxw') # 52.20428467, 0.11810303, # 52.20565796, 0.11947632 >>> geohash.decode('u120fxw') # '52.205', '0.1188' |
Decode a geohash to lat-/longitude of the (approximate centre of) geohash cell, to reasonable precision.
Example: >>> geohash.decode('u120fxw') # '52.205', '0.1188' >>> geohash.decode('sunny') # '23.708', '42.473' Saudi Arabia >>> geohash.decode('fur') # '69.6', '-45.7' Greenland >>> geohash.decode('reef') # '-24.87', '162.95' Coral Sea >>> geohash.decode('geek') # '65.48', '-17.75' Iceland |
Return the relative lat-/longitude decoding errors for this geohash.
Example: >>> geohash.decode_error('u120fxw') # 0.00068665, 0.00068665 >>> geohash.decode_error('fur') # 0.703125, 0.703125 >>> geohash.decode_error('fu') # 2.8125, 5.625 >>> geohash.decode_error('f') # 22.5, 22.5 |
Estimate the distance between two geohash (from the cell sizes).
Example: >>> geohash.distance1('u120fxwsh', 'u120fxws0') # 15.239 |
Approximate the distance between two geohashes (with Pythagoras' theorem).
Example: >>> geohash.distance2('u120fxwsh', 'u120fxws0') # 19.0879 |
Compute the great-circle distance between two geohashes (using the Haversine formula).
Example: >>> geohash.distance3('u120fxwsh', 'u120fxws0') # 11.6978 |
Encode a lat-/longitude as a geohash, either to the specified or an automatically evaluated precision.
Example: >>> geohash.encode(52.205, 0.119, 7) # 'u120fxw' >>> geohash.encode(52.205, 0.119, 12) # 'u120fxwshvkg' >>> geohash.encode(52.205, 0.1188, 12) # 'u120fxws0jre' >>> geohash.encode(52.205, 0.1188) # 'u120fxw' >>> geohash.encode( 0, 0) # 's00000000000' |
Return the Geohashes for all 8 adjacent cells.
JS name: neighbours. |
Return the lat- and longitudinal size of this Geohash cell. |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Jun 27 17:08:33 2017 | http://epydoc.sourceforge.net |