Refactor SFCGAL test script in build-gdal.yml

Refactor SFCGAL test script to improve readability and structure.
This commit is contained in:
Alex38Lyon
2026-08-31 23:21:19 +02:00
committed by GitHub
parent e08760594d
commit c67d53a0bd
+8 -23
View File
@@ -251,19 +251,13 @@ jobs:
- name: Test SFCGAL via OGR - name: Test SFCGAL via OGR
shell: bash -el {0} shell: bash -el {0}
run: | run: |
python -c '
python - <<'PY'
from osgeo import ogr from osgeo import ogr
from osgeo import gdal from osgeo import gdal
print("========================================") print("GDAL :", gdal.VersionInfo("--version"))
print("TEST SFCGAL")
print("========================================")
print(gdal.VersionInfo("--version")) geom = ogr.CreateGeometryFromWkt("""
wkt = """
POLYHEDRALSURFACE Z ( POLYHEDRALSURFACE Z (
( (
(0 0 0, (0 0 0,
@@ -273,27 +267,18 @@ jobs:
0 0 0) 0 0 0)
) )
) )
""" """)
geom = ogr.CreateGeometryFromWkt(wkt)
if geom is None:
raise RuntimeError(
"Impossible de créer la géométrie 3D"
)
print("Type :", geom.GetGeometryName()) print("Type :", geom.GetGeometryName())
print("Geometry type :", geom.GetGeometryType()) print("Geometry type :", geom.GetGeometryType())
print("Has Z :", ogr.GT_HasZ(geom.GetGeometryType())) print("Has Z :", ogr.GT_HasZ(geom.GetGeometryType()))
print("IsValid() :", geom.IsValid())
valid = geom.IsValid() if geom is None:
raise RuntimeError("Impossible de créer la géométrie 3D")
print("IsValid() :", valid)
print()
print("SFCGAL accessible par OGR : OK") print("SFCGAL accessible par OGR : OK")
'
PY
# ============================================================ # ============================================================
# 12. Création du package GDAL + SFCGAL # 12. Création du package GDAL + SFCGAL