Exemplo n.º 1
0
    def takeoff_location(self):
        if self.takeoff_location_wkt is None:
            return None

        wkt = DBSession.scalar(self.takeoff_location_wkt.wkt)
        return Location.from_wkt(wkt)
Exemplo n.º 2
0
    def landing_location(self):
        if self.landing_location_wkt is None:
            return None

        wkt = DBSession.scalar(self.landing_location_wkt.wkt)
        return Location.from_wkt(wkt)
Exemplo n.º 3
0
 def distance(self, location):
     loc1 = cast(self.location_wkt.wkt, 'geography')
     loc2 = func.ST_GeographyFromText(location.to_wkt())
     return DBSession.scalar(func.ST_Distance(loc1, loc2))