示例#1
0
 def json(self,):
     """creates json from data entry"""
     _json_data = []
     for row in self.data:
         _json_data.append([sensor_tools.timestamp_to_timedelta(row[0]),
                                                                 row[1]])
     return _json_data
示例#2
0
 def json(self, ):
     """creates json from data entry"""
     _json_data = []
     for row in self.data:
         _json_data.append(
             [sensor_tools.timestamp_to_timedelta(row[0]), row[1]])
     return _json_data
示例#3
0
 def json(self,):
     """return json of geospatial element"""
     return {'source':self.source, 'type':self.type, 'geom':self.geom,
             'name':self.name, 'reading':self.reading, 'value':self.value,
             'units':self.units, 
             'time':{
                 'string':str(self.timestamp), 
                 'json':sensor_tools.timestamp_to_timedelta(self.timestamp)
                 }
             }
 
     
示例#4
0
 def json(self, ):
     """return json of geospatial element"""
     return {
         'source': self.source,
         'type': self.type,
         'geom': self.geom,
         'name': self.name,
         'reading': self.reading,
         'value': self.value,
         'units': self.units,
         'time': {
             'string': str(self.timestamp),
             'json': sensor_tools.timestamp_to_timedelta(self.timestamp)
         }
     }