Skip to content

Commit

Permalink
Merge pull request #139 from QGEP/2024-05-07-skip-labels-with-empty-L…
Browse files Browse the repository at this point in the history
…abelText

Add code to skip labels if LabelText is empty.
  • Loading branch information
ponceta authored May 7, 2024
2 parents cfa67c2 + 60a269c commit ef39925
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions qgepqwat2ili/qgep/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
8 changes: 8 additions & 0 deletions qgepqwat2ili/qgepdss/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -3561,6 +3561,14 @@ 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")
Expand Down
8 changes: 8 additions & 0 deletions qgepqwat2ili/qgepsia405/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,14 @@ 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")
Expand Down

0 comments on commit ef39925

Please sign in to comment.