Skip to content

Commit e901a6c

Browse files
committed
re add initfile
1 parent de3963c commit e901a6c

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

geohash/__init__.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""
2+
Copyright (C) 2008 Leonard Norrgard <leonard.norrgard@gmail.com>
3+
Copyright (C) 2015 Leonard Norrgard <leonard.norrgard@gmail.com>
4+
5+
This file is part of Geohash.
6+
7+
Geohash is free software: you can redistribute it and/or modify it
8+
under the terms of the GNU Affero General Public License as published
9+
by the Free Software Foundation, either version 3 of the License, or
10+
(at your option) any later version.
11+
12+
Geohash is distributed in the hope that it will be useful, but WITHOUT
13+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
15+
License for more details.
16+
17+
You should have received a copy of the GNU Affero General Public
18+
License along with Geohash. If not, see
19+
<http://www.gnu.org/licenses/>.
20+
"""
21+
from .geohash import decode_exactly, decode, encode

geohash/geohash.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
License along with Geohash. If not, see
1919
<http://www.gnu.org/licenses/>.
2020
"""
21-
from math import log10 as _log10
21+
from math import log10 as log10
2222

2323
# Note: the alphabet in geohash differs from the common base32
2424
# alphabet described in IETF's RFC 4648
@@ -69,8 +69,8 @@ def decode(geohash):
6969
"""
7070
lat, lon, lat_err, lon_err = decode_exactly(geohash)
7171
# Format to the number of decimals that are known
72-
prec_lat = max(1, int(round(-_log10(lat_err)))) - 1
73-
prec_lon = max(1, int(round(-_log10(lon_err)))) - 1
72+
prec_lat = max(1, int(round(-log10(lat_err)))) - 1
73+
prec_lon = max(1, int(round(-log10(lon_err)))) - 1
7474
lats = f"{lat:.{prec_lat}f}"
7575
lons = f"{lon:.{prec_lon}f}"
7676
lats = lats.rstrip('0') if "." in lats else lats

0 commit comments

Comments
 (0)