Wrappe modular aufgebaut, Tests erfolgreich, Menüleiste und Werzeugleiste werden eingetragen (QT6 und QT5)- (Es fehlen noch Fachplugins, um zu prüfen, ob es auch wirklich in QGIS geht)

This commit is contained in:
2025-12-19 14:29:52 +01:00
parent e8fea163b5
commit f88b5da51f
37 changed files with 1886 additions and 1679 deletions

View File

@@ -0,0 +1,57 @@
# sn_basis/functions/ly_geometry_wrapper.py
def get_layer_geometry_type(layer) -> str:
if layer is None:
return "None"
geometry_type = getattr(layer, "geometry_type", None)
if geometry_type is not None:
return str(geometry_type)
try:
if callable(getattr(layer, "isSpatial", None)) and not layer.isSpatial():
return "None"
gtype = getattr(layer, "geometryType", None)
if callable(gtype):
value = gtype()
if not isinstance(value, int):
return "None"
return {
0: "Point",
1: "LineString",
2: "Polygon",
}.get(value, "None")
except Exception:
pass
return "None"
def get_layer_feature_count(layer) -> int:
if layer is None:
return 0
count = getattr(layer, "feature_count", None)
if count is not None:
if isinstance(count, int):
return count
return 0
try:
if callable(getattr(layer, "isSpatial", None)) and not layer.isSpatial():
return 0
fc = getattr(layer, "featureCount", None)
if callable(fc):
value = fc()
if isinstance(value, int):
return value
except Exception:
pass
return 0