fixed geojson script

This commit is contained in:
dennisdebel 2020-12-04 21:45:05 +01:00
parent f3cdf5a95f
commit b44301b09d
24 changed files with 172415 additions and 206898 deletions

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

View File

@ -9,7 +9,6 @@ from collections import OrderedDict
arg = int(sys.argv[1]) arg = int(sys.argv[1])
#read json file #read json file
with open("historicalData.json", "r") as read_file: with open("historicalData.json", "r") as read_file:
data = json.load(read_file) data = json.load(read_file)
@ -31,25 +30,31 @@ t = [] # list containing last location update times
p = {} # dictionairy containing times and positions p = {} # dictionairy containing times and positions
nest = [] 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) #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]['lastPos']+'|'+data[i][j]['lastLocationUpdate'])
#l.append(data[i][j]['lastLocationUpdate']) #l.append(data[i][j]['lastLocationUpdate'])
#p.update(i:{data[i][j]['lastPos'],data[i][j]['lastLocationUpdate']}) #p.update(i:{data[i][j]['lastPos'],data[i][j]['lastLocationUpdate']})
#l.append(data[i][j]['lastPos']) #l.append(data[i][j]['lastPos'])
#nest.append(data[i][j]['lastLocationUpdate']) #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 # if entry / pos is the same/double..remove? mmm
#uniquePos = set(l) # remove duplicates from all entries #uniquePos = set(l) # remove duplicates from all entries
#print(l[0]) #print(l[0])
# construct GeoJSON # construct GeoJSON
#list format: l[list index][0=lat,long,1=timestamp]
string1 = (""" string1 = ("""
{ "type": "FeatureCollection", { "type": "FeatureCollection",
"features": [ "features": [

Binary file not shown.