From 0527ba1fa516650b33fec620b57169b6e582b027 Mon Sep 17 00:00:00 2001 From: SJiB Date: Tue, 7 May 2024 13:55:05 +0200 Subject: [PATCH] Add code to skip labels if LabelText is empty. Backported from teksi tww https://github.com/teksi/wastewater/blob/3acfba249866d299f8a22e249d9f1e475fe7b88d/plugin/teksi_wastewater/interlis/interlis_model_mapping/interlis_exporter_to_intermediate_schema.py#L2667 and following --- qgepqwat2ili/qgep/export.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/qgepqwat2ili/qgep/export.py b/qgepqwat2ili/qgep/export.py index ec9d7793..7fb27d24 100644 --- a/qgepqwat2ili/qgep/export.py +++ b/qgepqwat2ili/qgep/export.py @@ -1090,6 +1090,15 @@ def textpos_common(row, t_type, geojson_crs_def): layer_name = label["properties"]["Layer"] obj_id = label["properties"]["qgep_obj_id"] + print(f"label[properties]: {label['properties']}") + + if not label["properties"]["LabelText"]: + logger.warning( + f"Label of object '{obj_id}' from layer '{layer_name}' is empty and will not be exported" + ) + continue + + if layer_name == "vw_qgep_reach": if obj_id not in tid_for_obj_id["haltung"]: logger.warning(f"Label for haltung `{obj_id}` exists, but that object is not part of the export")