aboutsummaryrefslogtreecommitdiff
path: root/dev/utah
diff options
context:
space:
mode:
Diffstat (limited to 'dev/utah')
-rw-r--r--dev/utah/convert.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/dev/utah/convert.py b/dev/utah/convert.py
index b02fc5c..763bc39 100644
--- a/dev/utah/convert.py
+++ b/dev/utah/convert.py
@@ -5,20 +5,20 @@ from pprint import pprint
info = dict()
for place in ET.parse('UtahKML.xml').findall('.//{*}Placemark'):
- cam_id = int(place.attrib['id'])
+ cam_id = place.attrib['id']
cam_name = place.find(".//{*}SimpleData[@name='DisplayName']").text
- coords = [float(x) for x in place.find(".//{*}coordinates").text.split(',')]
- info[cam_id] = {'name': cam_name, 'coords': coords}
+ coord = [float(x) for x in reversed(place.find(".//{*}coordinates").text.split(','))]
+ info[cam_id] = {'name': cam_name, 'coord': coord}
sources = []
with open('cameras.json', 'r') as f:
places = json.load(f)
for place in places:
- cam_id = place['entityId']
+ cam_id = str(place['entityId'])
url = place['url']
this_info = info[cam_id]
name = this_info['name']
- coords = this_info['coords']
- sources.append({'coords': coords, 'cams': [{'id': cam_id, 'url': url, 'name': name}]})
+ coord = this_info['coord']
+ sources.append({'coord': coord, 'cams': [{'id': cam_id, 'url': url, 'name': name}]})
with open('sources.json', 'w') as f:
json.dump(sources, f)