Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorIlya Zverev <zverik@textual.ru>2016-11-24 17:37:26 +0300
committerIlya Zverev <zverik@textual.ru>2016-11-24 17:37:26 +0300
commit084c22db035c2357471ee6d3950b03e3b3a0bff8 (patch)
treeaec5bd0bcee1a23b0eaf380e1db7222ac9b3c9b2 /tools
parentd0de17010e54e7c3dfdfc04e93f029df2588d00c (diff)
[booking] Fix processing of empty coordinates in China
Diffstat (limited to 'tools')
-rwxr-xr-xtools/python/booking_hotels.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/python/booking_hotels.py b/tools/python/booking_hotels.py
index 8b315d7e3e..c8bd57a342 100755
--- a/tools/python/booking_hotels.py
+++ b/tools/python/booking_hotels.py
@@ -145,8 +145,12 @@ def translate(source, output):
# Fix chinese coordinates
for hotel in data:
if hotel['countrycode'] == 'cn' and 'location' in hotel:
- hotel['location']['latitude'], hotel['location']['longitude'] = eviltransform.gcj2wgs_exact(
- float(hotel['location']['latitude']), float(hotel['location']['longitude']))
+ try:
+ hotel['location']['latitude'], hotel['location']['longitude'] = eviltransform.gcj2wgs_exact(
+ float(hotel['location']['latitude']), float(hotel['location']['longitude']))
+ except ValueError:
+ # We don't care if there were errors converting coordinates to float
+ pass
# Dict of dicts city_id -> { currency -> [prices] }
cities = defaultdict(lambda: defaultdict(list))