forked from organicmaps/organicmaps
[booking] Fix processing of empty coordinates in China
This commit is contained in:
parent
d0de17010e
commit
084c22db03
1 changed files with 6 additions and 2 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue