Ejemplo n.º 1
0
 def __init__(self, name, description, start_timestamp=timetools.now(), end_timestamp=timetools.now(), 
             center_id=None, uuid=str(uuidlib.uuid4())):
     self.name = name
     self.description = description
     self.start_timestamp = start_timestamp
     self.end_timestamp = end_timestamp
     self.reduced_trackpoints = reduce_trackpoints(trackpoints, epsilon)
     self.bbox = bbox
     self.center_id = center_id
     self.uuid = uuid
Ejemplo n.º 2
0
 def __init__(self, etappe, mode, distance, timespan, trackpoint_count,
             start_timestamp, end_timestamp, trackpoints, epsilon, 
             bbox=None, center_id=None, uuid=str(uuidlib.uuid4())):
     self.etappe = etappe.id
     self.distance = distance
     self.mode = mode
     self.timespan = timespan
     self.trackpoint_count = trackpoint_count
     self.start_timestamp = start_timestamp
     self.end_timestamp = end_timestamp
     self.reduced_trackpoints = reduce_trackpoints(trackpoints, epsilon)
     self.bbox = bbox
     self.center_id = center_id
     self.uuid = uuid
Ejemplo n.º 3
0
 def __init__(self,
              name,
              description,
              start_timestamp=timetools.now(),
              end_timestamp=timetools.now(),
              center_id=None,
              uuid=str(uuidlib.uuid4())):
     self.name = name
     self.description = description
     self.start_timestamp = start_timestamp
     self.end_timestamp = end_timestamp
     self.reduced_trackpoints = reduce_trackpoints(trackpoints, epsilon)
     self.bbox = bbox
     self.center_id = center_id
     self.uuid = uuid
Ejemplo n.º 4
0
def reduce_tracks(request):
    if request.query_string:
        track_id = request.GET.get('trackid')
        epsilon = Decimal(request.GET.get('epsilon'))
        log.debug(epsilon)
        #track = Track.get_track_by_id(track_id)
        #tracks = DBSession.query(Track).filter(Track.id == track_id).all()
        #tracks = DBSession.query(Track).all()
        #etappes = DBSession.query(Etappe).all()
        tours = DBSession.query(Tour).all()
        for tour in tours:
            rtp = list()
            for etappe in tour.etappes:
                for track in etappe.tracks:
                    rtp.append(reduce_trackpoints(track.trackpoints, 0.005))
            tour.reduced_trackpoints = json.dumps(rtp)
            DBSession.flush()

    return Response('OK')
Ejemplo n.º 5
0
def reduce_tracks(request):
    if request.query_string:
        track_id = request.GET.get('trackid')
        epsilon = Decimal(request.GET.get('epsilon'))
        log.debug(epsilon)
        #track = Track.get_track_by_id(track_id)
        #tracks = DBSession.query(Track).filter(Track.id == track_id).all()
        #tracks = DBSession.query(Track).all()
        #etappes = DBSession.query(Etappe).all()
        tours = DBSession.query(Tour).all()
        for tour in tours:
            rtp = list()
            for etappe in tour.etappes:
                for track in etappe.tracks:
                    rtp.append(reduce_trackpoints(track.trackpoints, 0.005))
            tour.reduced_trackpoints = json.dumps(rtp)
            DBSession.flush()
        
    return Response('OK')
Ejemplo n.º 6
0
 def __init__(self,
              etappe,
              mode,
              distance,
              timespan,
              trackpoint_count,
              start_timestamp,
              end_timestamp,
              trackpoints,
              epsilon,
              bbox=None,
              center_id=None,
              uuid=str(uuidlib.uuid4())):
     self.etappe = etappe.id
     self.distance = distance
     self.mode = mode
     self.timespan = timespan
     self.trackpoint_count = trackpoint_count
     self.start_timestamp = start_timestamp
     self.end_timestamp = end_timestamp
     self.reduced_trackpoints = reduce_trackpoints(trackpoints, epsilon)
     self.bbox = bbox
     self.center_id = center_id
     self.uuid = uuid