Add regional DOV soil operator
This commit is contained in:
@@ -257,7 +257,15 @@ def iter_wfs_pages(
|
||||
break
|
||||
|
||||
|
||||
def normalize_feature(feature: dict[str, Any], boundary_lambert72) -> tuple[dict[str, Any] | None, bool]:
|
||||
def normalize_feature(
|
||||
feature: dict[str, Any],
|
||||
boundary_lambert72,
|
||||
*,
|
||||
municipality: str = "Mol",
|
||||
nis_code: str = "13025",
|
||||
coverage_scope: str = "municipality",
|
||||
feature_id_suffix: str | None = None,
|
||||
) -> tuple[dict[str, Any] | None, bool]:
|
||||
geometry_payload = feature.get("geometry")
|
||||
if not geometry_payload:
|
||||
return None, False
|
||||
@@ -279,18 +287,19 @@ def normalize_feature(feature: dict[str, Any], boundary_lambert72) -> tuple[dict
|
||||
gid = raw.get("gid")
|
||||
map_polygon_id = raw.get("id_kaartvlak")
|
||||
source_id = str(feature.get("id") or f"{TYPE_NAME}:{gid or map_polygon_id}")
|
||||
persisted_id = f"{source_id}:{feature_id_suffix}" if feature_id_suffix else source_id
|
||||
properties = {
|
||||
"source_name": SOURCE_NAME,
|
||||
"source_collection": TYPE_NAME,
|
||||
"source_feature_id": source_id,
|
||||
"source_feature_id": persisted_id,
|
||||
"source_gid": gid,
|
||||
"source_map_polygon_id": map_polygon_id,
|
||||
"reference_layer_name": "soil",
|
||||
"theme": "soil",
|
||||
"authority_level": "authoritative_historical_baseline",
|
||||
"coverage_scope": "municipality",
|
||||
"municipality": "Mol",
|
||||
"nis_code": "13025",
|
||||
"coverage_scope": coverage_scope,
|
||||
"municipality": municipality,
|
||||
"nis_code": nis_code,
|
||||
"source_version": SOURCE_VERSION,
|
||||
"survey_period": SURVEY_PERIOD,
|
||||
"soil_type_code": raw.get("Bodemtype"),
|
||||
@@ -317,7 +326,7 @@ def normalize_feature(feature: dict[str, Any], boundary_lambert72) -> tuple[dict
|
||||
}
|
||||
return {
|
||||
"type": "Feature",
|
||||
"id": source_id,
|
||||
"id": persisted_id,
|
||||
"geometry": mapping(clipped_wgs84),
|
||||
"properties": properties,
|
||||
}, was_clipped
|
||||
|
||||
Reference in New Issue
Block a user