|
1 | 1 | ======= |
2 | | -Geohash |
| 2 | +geohash |
3 | 3 | ======= |
4 | 4 |
|
5 | | -Geohash is a Python module that provides functions for decoding and |
6 | | -encoding Geohashes_ to and from latitude and longitude coordinates. |
| 5 | +geohash is a Python module that provides functions for decoding and |
| 6 | +encoding geohashes_ to and from latitude and longitude coordinates. |
7 | 7 |
|
8 | 8 | Example:: |
9 | 9 |
|
10 | | - >>> import Geohash |
11 | | - >>> print 'Geohash for 42.6, -5.6:', Geohash.encode(42.6, -5.6) |
12 | | - Geohash for 42.6, -5.6: ezs42e44yx96 |
| 10 | + >>> import geohash |
| 11 | + >>> print ('geohash for 42.6, -5.6:', geohash.encode(42.6, -5.6)) |
| 12 | + geohash for 42.6, -5.6: ezs42e44yx96 |
13 | 13 |
|
14 | 14 | You can specify an arbitrary precision when encoding. The precision |
15 | | -determines the number of characters in the Geohash:: |
| 15 | +determines the number of characters in the geohash:: |
16 | 16 |
|
17 | | - >>> print 'Geohash for 42.6, -5.6:', Geohash.encode(42.6, -5.6, precision=5) |
18 | | - Geohash for 42.6, -5.6: ezs42 |
| 17 | + >>> print ('geohash for 42.6, -5.6:', geohash.encode(42.6, -5.6, precision=5)) |
| 18 | + geohash for 42.6, -5.6: ezs42 |
19 | 19 |
|
20 | | -Decoding a Geohash returns a (latitude, longitude) tuple:: |
| 20 | +Decoding a geohash returns a (latitude, longitude) tuple:: |
21 | 21 |
|
22 | | - >>> print 'Coordinate for Geohash ezs42:', Geohash.decode('ezs42') |
23 | | - Coordinate for Geohash ezs42: ('42.6', '-5.6') |
| 22 | + >>> print ('Coordinate for geohash ezs42:', geohash.decode('ezs42')) |
| 23 | + Coordinate for geohash ezs42: ('42.6', '-5.6') |
24 | 24 |
|
25 | | -The Geohash module also provides exact decoding with error margin |
| 25 | +The geohash module also provides exact decoding with error margin |
26 | 26 | results. The decode_exactly function returns a tuple of four float |
27 | 27 | values; latitude, longitude, latitude error margin, longitude error |
28 | 28 | margin:: |
29 | 29 |
|
30 | | - >>> print 'Exact coordinate for Geohash ezs42:\n', Geohash.decode_exactly('ezs42') |
31 | | - Exact coordinate for Geohash ezs42: |
| 30 | + >>> print ('Exact coordinate for geohash ezs42:\n', geohash.decode_exactly('ezs42')) |
| 31 | + Exact coordinate for geohash ezs42: |
32 | 32 | (42.60498046875, -5.60302734375, 0.02197265625, 0.02197265625) |
33 | 33 |
|
34 | 34 | The last two values are the plus/minus error margin of the latitude |
35 | 35 | and longitude respectively. In this particular case the error margins |
36 | 36 | happen to be the same for both the latitude and the longitude, but |
37 | | -this is just a co-incidence due to the precision of the Geohash and |
| 37 | +this is just a co-incidence due to the precision of the geohash and |
38 | 38 | thus the number of bits used for the latitude and longitude encoding, |
39 | 39 | respectively. |
40 | 40 |
|
41 | 41 | Download |
42 | 42 | ======== |
43 | 43 |
|
44 | | -Geohash is available for download from github_ and from the `Python Package Index`_. |
| 44 | +geohash is available for download from github_ and from the `Python Package Index`_. |
45 | 45 |
|
46 | 46 | License |
47 | 47 | ======= |
48 | 48 |
|
49 | 49 | Copyright (C) 2008 Leonard Norrgard <leonard.norrgard@gmail.com> |
50 | 50 | Copyright (C) 2015 Leonard Norrgard <leonard.norrgard@gmail.com> |
51 | 51 |
|
52 | | -Geohash is free software: you can redistribute it and/or modify it |
| 52 | +geohash is free software: you can redistribute it and/or modify it |
53 | 53 | under the terms of the GNU Affero General Public License as published |
54 | 54 | by the Free Software Foundation, either version 3 of the License, or |
55 | 55 | (at your option) any later version. |
56 | 56 |
|
57 | | -Geohash is distributed in the hope that it will be useful, but WITHOUT |
| 57 | +geohash is distributed in the hope that it will be useful, but WITHOUT |
58 | 58 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
59 | 59 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public |
60 | 60 | License for more details. |
61 | 61 |
|
62 | 62 | You should have received a copy of the GNU Affero General Public |
63 | | -License along with Geohash. If not, see |
| 63 | +License along with geohash. If not, see |
64 | 64 | <http://www.gnu.org/licenses/>. |
65 | 65 |
|
66 | 66 | History |
67 | 67 | ======= |
68 | 68 |
|
69 | | -The Geohash encoding was originally described by Gustavo Niemeyer and |
70 | | -the algorithm published in the Wikipedia Geohash_ article. |
| 69 | +The geohash encoding was originally described by Gustavo Niemeyer and |
| 70 | +the algorithm published in the Wikipedia geohash_ article. |
71 | 71 |
|
72 | | -This implementation of Geohashes was written by Leonard Norrgard |
| 72 | +This implementation of geohashes was written by Leonard Norrgard |
73 | 73 | <leonard.norrgard@gmail.com>. |
74 | 74 |
|
75 | 75 | Keywords |
76 | 76 | ======== |
77 | 77 |
|
78 | | -Geohash, GIS, latitude, longitude, encode, decode, Galileo, GPS, WGS84, coordinates, geotagging. |
| 78 | +geohash, GIS, latitude, longitude, encode, decode, Galileo, GPS, WGS84, coordinates, geotagging. |
79 | 79 |
|
80 | | -.. _Geohashes: http://en.wikipedia.org/wiki/Geohash |
81 | | -.. _github: https://github.com/vinsci/geohash/archive/master.zip |
| 80 | +.. _geohashes: http://en.wikipedia.org/wiki/geohash |
82 | 81 | .. _Python package index: http://pypi.python.org |
83 | | -.. _Geohash: http://en.wikipedia.org/wiki/Geohash |
| 82 | +.. _geohash: http://en.wikipedia.org/wiki/geohash |
84 | 83 |
|
85 | 84 | .. Local Variables: |
86 | 85 | .. mode:rst |
|
0 commit comments