File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed
Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 1818License 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
You can’t perform that action at this time.
0 commit comments