aboutsummaryrefslogtreecommitdiff
path: root/dev/georgia/convert.py
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2020-06-06 12:44:37 -0600
committerMelody Horn <melody@boringcactus.com>2020-06-06 12:44:37 -0600
commit48ebef95cfc26aae3fcef1174f4eaeb71ca491fe (patch)
tree4a8817fcfda72182b607d184ef192ca8ceef5a36 /dev/georgia/convert.py
parent4127ae91822f9abeffeb614e95b6f9d832ecf7c6 (diff)
downloadpig.observer-48ebef95cfc26aae3fcef1174f4eaeb71ca491fe.tar.gz
pig.observer-48ebef95cfc26aae3fcef1174f4eaeb71ca491fe.zip
make a whole pile of things more good
Diffstat (limited to 'dev/georgia/convert.py')
-rw-r--r--dev/georgia/convert.py31
1 files changed, 0 insertions, 31 deletions
diff --git a/dev/georgia/convert.py b/dev/georgia/convert.py
deleted file mode 100644
index 37a9e56..0000000
--- a/dev/georgia/convert.py
+++ /dev/null
@@ -1,31 +0,0 @@
-import json
-from pprint import pprint
-
-with open('cctv.json', 'r') as f:
- raw_data = json.load(f)
-
-cameras = raw_data['features']
-
-sources = []
-for camera in cameras:
- coord = [float(x) for x in reversed(camera['geometry']['coordinates'])]
- cam = dict()
- cam['id'] = camera['properties']['cctv_id']
- if 'HLS' in camera['properties']:
- url = camera['properties']['HLS']
- url = url.replace('http://vss1live.dot.ga.gov:80/lo', '/georgiavss1')
- url = url.replace('http://vss2live.dot.ga.gov:80/lo', '/georgiavss2')
- url = url.replace('http://vss3live.dot.ga.gov:80/lo', '/georgiavss3')
- url = url.replace('http://vss4live.dot.ga.gov:80/lo', '/georgiavss4')
- url = url.replace('http://vss5live.dot.ga.gov:80/lo', '/georgiavss5')
- cam['stream'] = url
- elif camera['properties']['url'] is not None:
- url = camera['properties']['url']
- url = url.replace('http://navigator-c2c.dot.ga.gov/snapshots', '/georgiasnapshots')
- cam['url'] = url
- else:
- continue
- cam['name'] = camera['properties']['location_description']
- sources.append({'coord': coord, 'cams': [cam]})
-with open('sources.json', 'w') as f:
- json.dump(sources, f)