Browse Source

fixed geojson script

master
dennisdebel 4 years ago
parent
commit
b44301b09d
  1. 11494
      website/historical/geojson-csv/1.csv
  2. 22988
      website/historical/geojson-csv/1.json
  3. 11494
      website/historical/geojson-csv/10.csv
  4. 22978
      website/historical/geojson-csv/10.json
  5. 5748
      website/historical/geojson-csv/11.csv
  6. 28740
      website/historical/geojson-csv/11.json
  7. 11494
      website/historical/geojson-csv/2.csv
  8. 22986
      website/historical/geojson-csv/2.json
  9. 11494
      website/historical/geojson-csv/3.csv
  10. 22988
      website/historical/geojson-csv/3.json
  11. 11494
      website/historical/geojson-csv/4.csv
  12. 22986
      website/historical/geojson-csv/4.json
  13. 11494
      website/historical/geojson-csv/5.csv
  14. 22988
      website/historical/geojson-csv/5.json
  15. 11494
      website/historical/geojson-csv/6.csv
  16. 22984
      website/historical/geojson-csv/6.json
  17. 11494
      website/historical/geojson-csv/7.csv
  18. 22988
      website/historical/geojson-csv/7.json
  19. 11494
      website/historical/geojson-csv/8.csv
  20. 22988
      website/historical/geojson-csv/8.json
  21. 11494
      website/historical/geojson-csv/9.csv
  22. 22988
      website/historical/geojson-csv/9.json
  23. 15
      website/historical/geojson-csv/convert-json-to-geojson.py
  24. BIN
      website/historical/geojson-csv/csv+json.zip

11494
website/historical/geojson-csv/1.csv

File diff suppressed because it is too large

22988
website/historical/geojson-csv/1.json

File diff suppressed because it is too large

11494
website/historical/geojson-csv/10.csv

File diff suppressed because it is too large

22978
website/historical/geojson-csv/10.json

File diff suppressed because it is too large

5748
website/historical/geojson-csv/11.csv

File diff suppressed because it is too large

28740
website/historical/geojson-csv/11.json

File diff suppressed because it is too large

11494
website/historical/geojson-csv/2.csv

File diff suppressed because it is too large

22986
website/historical/geojson-csv/2.json

File diff suppressed because it is too large

11494
website/historical/geojson-csv/3.csv

File diff suppressed because it is too large

22988
website/historical/geojson-csv/3.json

File diff suppressed because it is too large

11494
website/historical/geojson-csv/4.csv

File diff suppressed because it is too large

22986
website/historical/geojson-csv/4.json

File diff suppressed because it is too large

11494
website/historical/geojson-csv/5.csv

File diff suppressed because it is too large

22988
website/historical/geojson-csv/5.json

File diff suppressed because it is too large

11494
website/historical/geojson-csv/6.csv

File diff suppressed because it is too large

22984
website/historical/geojson-csv/6.json

File diff suppressed because it is too large

11494
website/historical/geojson-csv/7.csv

File diff suppressed because it is too large

22988
website/historical/geojson-csv/7.json

File diff suppressed because it is too large

11494
website/historical/geojson-csv/8.csv

File diff suppressed because it is too large

22988
website/historical/geojson-csv/8.json

File diff suppressed because it is too large

11494
website/historical/geojson-csv/9.csv

File diff suppressed because it is too large

22988
website/historical/geojson-csv/9.json

File diff suppressed because it is too large

15
website/historical/geojson-csv/convert-json-to-geojson.py

@ -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": [

BIN
website/historical/geojson-csv/csv+json.zip

Binary file not shown.
Loading…
Cancel
Save