Skip to content

Commit

Permalink
Merge pull request #750 from nlehuby/tracejson
Browse files Browse the repository at this point in the history
convert to geojson with tracejson
  • Loading branch information
shankari committed Aug 2, 2020
2 parents ebb5cb8 + 62d31fd commit 7a49a9c
Show file tree
Hide file tree
Showing 4 changed files with 828 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,19 @@ def point_array_to_line(point_array):
# points_line_string.coordinates = [l.loc.coordinates for l in filtered_section_location_array]
points_line_string.coordinates = []
points_times = []
points_timestamps = []

for l in point_array:
# logging.debug("About to add %s to line_string " % l)
points_line_string.coordinates.append(l.data.loc.coordinates)
points_times.append(l.data.ts)
points_timestamps.append(int(round(l.data.ts * 1000)))

points_line_feature = gj.Feature()
points_line_feature.geometry = points_line_string
points_line_feature.properties = {}
points_line_feature.properties["times"] = points_times
points_line_feature.properties["timestamps"] = points_timestamps
return points_line_feature

def trip_to_geojson(trip, tl):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@
]
},
"properties": {
"times": [
"times": [
1452970948.0723116,
1452970978.0723116,
1452971008.0723116,
Expand Down Expand Up @@ -472,6 +472,41 @@
1452971858.0,
1452971858.0
],
"timestamps": [
1452970948072,
1452970978072,
1452971008072,
1452971038072,
1452971068072,
1452971098072,
1452971128072,
1452971158072,
1452971188072,
1452971218072,
1452971248072,
1452971278072,
1452971308072,
1452971338072,
1452971368072,
1452971398072,
1452971428072,
1452971458072,
1452971488072,
1452971518072,
1452971548072,
1452971578072,
1452971608072,
1452971638072,
1452971668072,
1452971698072,
1452971728072,
1452971758072,
1452971788072,
1452971818072,
1452971848072,
1452971858000,
1452971858000
],
"source": "SmoothedHighConfidenceMotion",
"trip_id": {
"$oid": "5a357edaf6858fe2e1156f63"
Expand Down Expand Up @@ -718,6 +753,33 @@
1452972518.0,
1452972533.0
],
"timestamps": [
1452971858000,
1452971858000,
1452971888000,
1452971918000,
1452971948000,
1452971978000,
1452972008000,
1452972038000,
1452972068000,
1452972098000,
1452972128000,
1452972158000,
1452972188000,
1452972218000,
1452972248000,
1452972278000,
1452972308000,
1452972338000,
1452972368000,
1452972398000,
1452972428000,
1452972458000,
1452972488000,
1452972518000,
1452972533000
],
"source": "SmoothedHighConfidenceMotion",
"trip_id": {
"$oid": "5a357edaf6858fe2e1156f63"
Expand Down Expand Up @@ -1181,6 +1243,26 @@
1452983409.43532,
1452983423.0
],
"timestamps": [
1452982929435,
1452982959435,
1452982989435,
1452983019435,
1452983049435,
1452983079435,
1452983109435,
1452983139435,
1452983169435,
1452983199435,
1452983229435,
1452983259435,
1452983289435,
1452983319435,
1452983349435,
1452983379435,
1452983409435,
1452983423000
],
"source": "SmoothedHighConfidenceMotion",
"trip_id": {
"$oid": "5a357edbf6858fe2e1156fac"
Expand Down Expand Up @@ -1354,6 +1436,24 @@
1452983845,
1452983871
],
"timestamps": [
1452983425000,
1452983455000,
1452983485000,
1452983515000,
1452983545000,
1452983575000,
1452983605000,
1452983635000,
1452983665000,
1452983695000,
1452983725000,
1452983755000,
1452983785000,
1452983815000,
1452983845000,
1452983871000
],
"source": "SmoothedHighConfidenceMotion",
"trip_id": {
"$oid": "5a357edbf6858fe2e1156fac"
Expand Down Expand Up @@ -1434,4 +1534,4 @@
"id": "5a357edbf6858fe2e1156fac"
}
]
}
}
Loading

0 comments on commit 7a49a9c

Please sign in to comment.