def get_gdf_from_wfs(layer):
"""
Get geopandas.GeoDataFrame from data.wien.gv.at WFS service based on layer name
Parameters
----------
layer : string
WFS layer name
"""
file = f'data/{layer}.json'
url = f"https://data.wien.gv.at/daten/geo?service=WFS&request=GetFeature&version=1.1.0&typeName=ogdwien:{layer}&srsName=EPSG:4326&outputFormat=json"
if not exists(file):
urlretrieve(url, file)
return gpd.read_file(file)
Chapter 7 "Geographic data I/O" would profit from an example for fetching vector data from OGC WFS services.
Here's how I did it in a toy project:
https://github.com/anitagraser/ogd-at-lab/blob/1fd7c034b57d23fb95a93d40babbf0ae05021f4e/notebooks/utils/dataaccess.py#L6-L19