|
|
|
@ -6,6 +6,7 @@ Created on: 17.12.21
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
from abc import abstractmethod
|
|
|
|
|
from time import sleep
|
|
|
|
|
|
|
|
|
|
import requests
|
|
|
|
|
import xmltodict
|
|
|
|
@ -122,6 +123,7 @@ class ParcelWFSFetcher(AbstractWFSFetcher):
|
|
|
|
|
spatial_operator: str = "Intersects",
|
|
|
|
|
filter_srid: str = None,
|
|
|
|
|
start_index: int = 0,
|
|
|
|
|
rerun_on_exception: bool = True
|
|
|
|
|
):
|
|
|
|
|
""" Fetches features from the WFS using POST
|
|
|
|
|
|
|
|
|
@ -159,6 +161,23 @@ class ParcelWFSFetcher(AbstractWFSFetcher):
|
|
|
|
|
{},
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Check if collection is an exception and does not contain the requested data
|
|
|
|
|
if len(collection) == 0:
|
|
|
|
|
exception = content.get(
|
|
|
|
|
"ows:ExceptionReport",
|
|
|
|
|
{}
|
|
|
|
|
)
|
|
|
|
|
if len(exception) > 0 and rerun_on_exception:
|
|
|
|
|
# Wait a second before another try
|
|
|
|
|
sleep(1)
|
|
|
|
|
self.get_features(
|
|
|
|
|
typenames,
|
|
|
|
|
spatial_operator,
|
|
|
|
|
filter_srid,
|
|
|
|
|
start_index,
|
|
|
|
|
rerun_on_exception=False
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
members = collection.get(
|
|
|
|
|
"wfs:member",
|
|
|
|
|
[],
|
|
|
|
|