fixed geojson script
This commit is contained in:
parent
f3cdf5a95f
commit
b44301b09d
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -9,7 +9,6 @@ from collections import OrderedDict
|
||||
arg = int(sys.argv[1])
|
||||
|
||||
|
||||
|
||||
#read json file
|
||||
with open("historicalData.json", "r") as read_file:
|
||||
data = json.load(read_file)
|
||||
@ -31,25 +30,31 @@ t = [] # list containing last location update times
|
||||
p = {} # dictionairy containing times and positions
|
||||
nest = []
|
||||
|
||||
for j in range(arg): # if 1; print only first scooter (aram)
|
||||
#print(data[20][0]) # = data[data point (0-5746?)][scooter id (0-10)]
|
||||
|
||||
#for j in range(1): # if 1; print only first scooter (aram)
|
||||
#print(j)
|
||||
for i in range(5747): # all entries (data points)
|
||||
for i in range(5747): # all entries (data points)
|
||||
#l.append(data[i][j]['lastPos']+'|'+data[i][j]['lastLocationUpdate'])
|
||||
#l.append(data[i][j]['lastLocationUpdate'])
|
||||
#p.update(i:{data[i][j]['lastPos'],data[i][j]['lastLocationUpdate']})
|
||||
#l.append(data[i][j]['lastPos'])
|
||||
#nest.append(data[i][j]['lastLocationUpdate'])
|
||||
|
||||
l.append([data[i][j]['lastPos'], data[i][j]['lastLocationUpdate']]) #make 2d list
|
||||
|
||||
l.append([data[i][arg]['lastPos'], data[i][arg]['lastLocationUpdate']]) #make 2d list
|
||||
|
||||
|
||||
# if entry / pos is the same/double..remove? mmm
|
||||
|
||||
|
||||
#uniquePos = set(l) # remove duplicates from all entries
|
||||
#print(l[0])
|
||||
|
||||
|
||||
# construct GeoJSON
|
||||
|
||||
#list format: l[list index][0=lat,long,1=timestamp]
|
||||
|
||||
string1 = ("""
|
||||
{ "type": "FeatureCollection",
|
||||
"features": [
|
||||
|
BIN
website/historical/geojson-csv/csv+json.zip
Normal file
BIN
website/historical/geojson-csv/csv+json.zip
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user