コード例 #1
0
def new_location(longitude, latitude):
    ret = LocationPointType()
    ret.AccessTime = timedelta(seconds=100)
    l = LocationStructure()
    l.Longitude = longitude
    l.Latitude = latitude
    ret.Position = l
    return ret
コード例 #2
0
 def _new_stop_trace(place_id, longitude, latitude, link=False):
     ret = TraceStop()
     ret.AccessTime = datetime.timedelta()
     ret.PlaceTypeId = place_id + ("L" if link else "")
     l = LocationStructure()
     l.Longitude = longitude
     l.Latitude = latitude
     ret.Position = l
     return ret
コード例 #3
0
    def _new_location(place_id, longitude, latitude):
        ret = LocationContextType()
        ret.PlaceTypeId = place_id
        l = LocationStructure()
        l.Longitude = longitude
        l.Latitude = latitude
        ret.Position = l

        return ret
コード例 #4
0
    def _new_location(place_id, longitude, latitude):
        ret = LocationContextType()
        ret.PlaceTypeId = place_id
        l = LocationStructure()
        l.Longitude = longitude
        l.Latitude = latitude
        ret.Position = l

        return ret
コード例 #5
0
def stop_to_trace_stop(stop):
    ret = TraceStop()

    ret.AccessTime = timedelta()
    ret.PlaceTypeId = stop.code
    l = LocationStructure()
    l.Longitude = stop.long
    l.Latitude = stop.lat
    ret.Position = l

    return ret
コード例 #6
0
def stop_to_trace_stop(stop):
    ret = TraceStop()

    ret.AccessTime = timedelta()
    ret.PlaceTypeId = stop.code
    l = LocationStructure()
    l.Longitude = stop.long
    l.Latitude = stop.lat
    ret.Position = l

    return ret
コード例 #7
0
def parse_end_point(point, step_end_point=False):
    if step_end_point:
        ret = StepEndPointType()
        ret.PassThrough = point.get("PassThrough", False)
    else:
        ret = EndPointType()

    place = TripStopPlaceType()
    p = point["TripStopPlace"]
    place.id = p["id"]
    place.Name = p.get("Name", None)
    place.CityCode = p.get("CityCode", None)
    place.CityName = p.get("CityName", None)
    place.TypeOfPlaceRef = p.get("TypeOfPlaceRef", TypeOfPlaceEnum.LOCATION)
    if "Position" in p:
        place.Position = LocationStructure(
            Latitude=p["Position"]["Latitude"],
            Longitude=p["Position"]["Longitude"])

    ret.TripStopPlace = place
    ret.DateTime = datetime.strptime(point["DateTime"], DATE_FORMAT)
    return ret
コード例 #8
0
 def _stop_morillons(self, access_time=0):
     loc = LocationContextType()
     loc.Position = LocationStructure(Latitude=48.731742, Longitude=2.432025)
     loc.AccessTime = timedelta(minutes=access_time)
     loc.PlaceTypeId = "stop_area:DUA:SA:4:141"
     return loc
コード例 #9
0
 def _stop_thiais(self, access_time=0):
     loc = LocationContextType()
     loc.Position = LocationStructure(Latitude=48.76577965, Longitude=2.392136794)
     loc.AccessTime = timedelta(minutes=access_time)
     loc.PlaceTypeId = "stop_area:DUA:SA:4:126"
     return loc
コード例 #10
0
 def _stop_choisy(self, access_time=0):
     loc = LocationContextType()
     loc.Position = LocationStructure(Latitude=48.765177, Longitude=2.410013)
     loc.AccessTime = timedelta(minutes=access_time)
     loc.PlaceTypeId = "stop_area:DUA:SA:8754528"
     return loc
コード例 #11
0
 def _stop_orly(self, access_time=0):
     loc = LocationContextType()
     loc.Position = LocationStructure(Latitude=48.743411, Longitude=2.402955)
     loc.AccessTime = timedelta(minutes=access_time)
     loc.PlaceTypeId = "stop_area:DUA:SA:4:57"
     return loc