def test_filter_function_geometrie_collection(): p = geo.GeoProxy(copy.deepcopy(GEOMETRY_COLLECTION)) p.filter(validate) assert p.geotype == 'GeometryCollection' assert p.root['geometries'] == [POINT] gc2 = copy.deepcopy(GEOMETRY_COLLECTION) gc2['geometries'] = [LINE_STRING, POLYGON_0] p = geo.GeoProxy(gc2) p.filter(validate) assert p.geotype is None
def test_filter_function_feature_collection(): fc1 = copy.deepcopy(FEATURE_COLLECTION) point_feature = copy.deepcopy(FEATURE_1) point_feature['geometry'] = POINT fc1['features'].append(point_feature) p = geo.GeoProxy(fc1) p.filter(validate) assert p.geotype == 'FeatureCollection' assert p.root['features'] == [point_feature] p = geo.GeoProxy(copy.deepcopy(FEATURE_COLLECTION)) p.filter(validate) assert p.geotype is None
def test_filter_function_single_entity(entity, type_): p = geo.GeoProxy(copy.deepcopy(entity)) p.filter(validate) assert p.geotype == type_