In [1]:
import json
import os,sys,inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0,parentdir)
import loadOSCdata
In [20]:
#set the id from OSC
oscID=167913
#oscID=292590
In [21]:
#query the OSC API for that ID
query = "curl 'http://openstreetcam.org/details' -H 'Referer: http://openstreetcam.org/details/" + str(oscID) + "/0' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' --data 'id=" + str(oscID) + "&platform=web' --compressed >> osc.json"
os.system(query)
#read json file
with open('osc.json') as data_file:
data = json.load(data_file)
os.system('rm osc.json')
Out[21]:
In [22]:
#get the url for the file with accelerometer data
url='http://openstreetcam.org/'+data['osv']['meta_data_filename']
#read the accelerometer data with our function
data = loadOSCdata.loadOSCdata(url, X = True, Y = True, Z = True, output = 'shp', outputFile = 'sichen')
data.head()
Out[22]:
In [ ]: