Commit 053fcf04 authored by Eric Duminil's avatar Eric Duminil
Browse files

Basic WFS for BW

parent a07ff9b0
from citygml_download import Bundesland from citygml_download import Bundesland, TMP_DIR, download_file
import json
# Data are available as WFS
# NOTE: Use geopandas or specific WFS lib?
BW_WFS = "https://owsproxy.lgl-bw.de/owsproxy/wfs/WFS_LGL-BW_LoD2_Aktualitaet?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=verm:v_lod2_aktualitaet&MAXFEATURES=50000&OUTPUTFORMAT=application/json"
BADEN_WUERTTEMBERG = Bundesland( BADEN_WUERTTEMBERG = Bundesland(
"Baden-Württemberg", "Baden-Württemberg",
...@@ -6,3 +11,29 @@ BADEN_WUERTTEMBERG = Bundesland( ...@@ -6,3 +11,29 @@ BADEN_WUERTTEMBERG = Bundesland(
info="https://www.lgl-bw.de/Produkte/Open-Data/", info="https://www.lgl-bw.de/Produkte/Open-Data/",
license="dl-de/by-2-0", license="dl-de/by-2-0",
) )
if __name__ == "__main__":
bw_json = TMP_DIR / "bw_lod2.json"
download_file(
BW_WFS,
bw_json
)
with open(bw_json) as json_file:
data = json.load(json_file)
xs, ys = [], []
import matplotlib.pyplot as plt
for feature in data["features"]:
x, y = feature['bbox'][:2]
xs.append(x)
ys.append(y)
# citygmls.append(
# CityGMLWithDate(
# url=feature["properties"]["xml"],
# bundesland=NIEDERSACHSEN,
# source_date=datetime.strptime(feature["properties"]["Aktualitaet"], "%Y-%m-%d %H:%M:%S"),
# # coordinate_reference_system ?
# )
# )
plt.plot(xs, ys)
plt.show()
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