Exemple #1
0
class PolygonErrorFilter(ErrorFilter):
    def __init__(self, polygon_id, cache_delay=60):
        self.pip = PointInPolygon(polygon_id, cache_delay)

    def apply(self, classs, subclass, geom):
        if "position" not in geom:
            return False
        else:
            inside = False
            for position in geom["position"]:
                lat = float(position["lat"])
                lon = float(position["lon"])
                inside |= self.pip.point_inside_polygon(lon, lat)
            return inside
class PolygonErrorFilter(ErrorFilter):

    def __init__(self, polygon_id, cache_delay=60):
        self.pip = PointInPolygon(polygon_id, cache_delay)

    def apply(self, classs, subclass, geom):
        if "position" not in geom:
            return False
        else:
            inside = False
            for position in geom["position"]:
                lat = float(position["lat"])
                lon = float(position["lon"])
                inside |= self.pip.point_inside_polygon(lon, lat)
            return inside
Exemple #3
0
 def __init__(self, polygon_id, cache_delay=60):
     self.pip = PointInPolygon(polygon_id, cache_delay)
 def __init__(self, polygon_id, cache_delay=60):
     self.pip = PointInPolygon(polygon_id, cache_delay)