Commit c477b595 authored by Eric Duminil's avatar Eric Duminil
Browse files

Unused class

parent dd765087
# https://geodaten.schleswig-holstein.de/gaialight-sh/_apps/dladownload/single.php?file=LOD2_SH_Massendownload.geojson&id=4
from citygml_download import TMP_DIR, Bundesland, download_all_files, download_file
import json
from datetime import datetime
from citygml_download import TMP_DIR, Bundesland, CityGMLWithDate, download_all_files, download_file
SCHLESWIG_HOLSTEIN = Bundesland(
"Schleswig-Holstein",
source="https://geodaten.schleswig-holstein.de/gaialight-sh/_apps/dladownload/single.php?file=LOD2_SH_Massendownload.geojson&id=4",
info="https://www.schleswig-holstein.de/DE/landesregierung/ministerien-behoerden/LVERMGEOSH/Service/serviceGeobasisdaten/geodatenService_Geobasisdaten_LoD",
license="CC-BY 4.0",
kontakt="Vertrieb.Geobasisdaten@LVermGeo.LandSH.de"
kontakt="Vertrieb.Geobasisdaten@LVermGeo.LandSH.de",
)
if __name__ == "__main__":
geojson_path = TMP_DIR / f"{SCHLESWIG_HOLSTEIN}.geojson"
download_file(SCHLESWIG_HOLSTEIN.source, TMP_DIR / geojson_path)
with open(geojson_path) as json_file:
data = json.load(json_file)
citygmls = []
crs = data["crs"]["properties"]["name"]
features = data["features"]
for feature in features:
properties = feature["properties"]
citygmls.append(
CityGMLWithDate(
url=properties["link_data"],
bundesland=SCHLESWIG_HOLSTEIN,
source_date=datetime.strptime(properties["datum"], "%Y-%m-%d"),
coordinate_reference_system=crs,
)
)
download_all_files(citygmls)
......@@ -276,19 +276,3 @@ class CityGMLWithDate(CityGML):
return False
return True
@dataclass
class CityGMLWithCustomVerify(CityGML):
"""
CityGML file with custom verification function.
The verify_func should be set after instantiation:
obj = CityGMLWithCustomVerify(...)
obj.verify_func = lambda path: os.path.getsize(path) > 1000
"""
verify_func: Callable[[Path], bool] = lambda _path: False
def verify(self, file_path: Path) -> bool:
"""Verify file using custom function."""
return self.verify_func(file_path)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment