-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathevent_parsed_feed.py
More file actions
69 lines (66 loc) · 2.73 KB
/
Copy pathevent_parsed_feed.py
File metadata and controls
69 lines (66 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import datetime
import zoneinfo
from collections import OrderedDict
from django.contrib.gis.geos import LineString, Point
parsed_feed = OrderedDict([
("id", "DBC-52446"),
("description", "Highway 3. Road maintenance work between Bromley Pl "
"and Frontage Rd for 0.6 km (Princeton). Until Sat "
"Jul 22 at 7:00 AM PDT. Single lane alternating traffic. "
"Next update time Fri Jul 21 at 1:00 PM PDT. "
"Last updated Thu Jun 29 at 10:14 AM PDT. (DBC-52446)"),
("event_type", "CONSTRUCTION"),
("event_sub_type", "ROAD_MAINTENANCE"),
("status", "ACTIVE"),
("severity", "MAJOR"),
("route_at", "Highway 3"),
("route_from", "Bromley Pl"),
("route_to", "Frontage Rd"),
("direction", "NONE"),
("location", LineString([
[-120.528796, 49.446318],
[-120.528342, 49.447589],
[-120.527977, 49.448609],
[-120.527803, 49.449096],
[-120.527031, 49.450689],
[-120.526853, 49.451003],
[-120.526427, 49.451752]
])),
("location_description", "Highway 3 between Bromley Pl and Frontage Rd"),
("first_created", datetime.datetime(
2023, 5, 19, 14, 29, 20, tzinfo=zoneinfo.ZoneInfo(key="America/Vancouver")
)),
("last_updated", datetime.datetime(
2023, 6, 29, 10, 14, 55, tzinfo=zoneinfo.ZoneInfo(key="America/Vancouver")
)),
("priority", 7),
("schedule", {"intervals": ["2023-05-23T14:00/2023-07-22T14:00"]})
])
parsed_feed_2 = OrderedDict([
("id", "DBC-52446"),
("description", "Highway 3. Road maintenance work between Bromley Pl "
"and Frontage Rd for 0.6 km (Princeton). Until Sat "
"Jul 22 at 7:00 AM PDT. Single lane alternating traffic. "
"Next update time Fri Jul 21 at 1:00 PM PDT. "
"Last updated Thu Jun 29 at 10:14 AM PDT. (DBC-52446)"),
("event_type", "CONSTRUCTION"),
("event_sub_type", "ROAD_MAINTENANCE"),
("status", "ACTIVE"),
("severity", "MAJOR"),
("route_at", "Highway 3"),
("route_from", "Bromley Pl"),
("route_to", "Frontage Rd"),
("direction", "NONE"),
("location", Point(-120.526427, 49.451752)),
("location_description", "Highway 3 between Bromley Pl and Frontage Rd"),
# ("location", {"coordinates": [-120.526427, 49.451752]})
("coordinates", [-120.526427, 49.451752]),
("first_created", datetime.datetime(
2023, 5, 19, 14, 29, 20, tzinfo=zoneinfo.ZoneInfo(key="America/Vancouver")
)),
("last_updated", datetime.datetime(
2023, 6, 29, 10, 14, 55, tzinfo=zoneinfo.ZoneInfo(key="America/Vancouver")
)),
("priority", 7),
("schedule", {"intervals": ["2023-05-23T14:00/2023-07-22T14:00"]})
])