mirror of
https://github.com/Alex38Lyon/Synthese-PSM_LARRA.git
synced 2026-09-30 07:21:55 +00:00
Refactor SFCGAL test script in build-gdal.yml
Refactor SFCGAL test script to improve readability and structure.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user