From 46f390cb869f1fd3c0fea1adbb441788dc960528 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 4 Dec 2024 12:44:10 +0100 Subject: [PATCH] gdalvrt.xsd: fix schema to reflect that can be a child of --- .../data/vrt/arraysource_array_constant.vrt | 13 +++++ autotest/gdrivers/vrtmultidim.py | 6 +++ frmts/vrt/data/gdalvrt.xsd | 54 ++++++++++--------- 3 files changed, 49 insertions(+), 24 deletions(-) create mode 100644 autotest/gdrivers/data/vrt/arraysource_array_constant.vrt diff --git a/autotest/gdrivers/data/vrt/arraysource_array_constant.vrt b/autotest/gdrivers/data/vrt/arraysource_array_constant.vrt new file mode 100644 index 000000000000..fda51041d605 --- /dev/null +++ b/autotest/gdrivers/data/vrt/arraysource_array_constant.vrt @@ -0,0 +1,13 @@ + + + real + + + Float64 + + + 10 + + + + diff --git a/autotest/gdrivers/vrtmultidim.py b/autotest/gdrivers/vrtmultidim.py index 310d2df3584e..4bb746e576e0 100755 --- a/autotest/gdrivers/vrtmultidim.py +++ b/autotest/gdrivers/vrtmultidim.py @@ -1420,6 +1420,12 @@ def test_vrtmultidim_arraysource_array(): assert ds.GetRasterBand(1).Checksum() == 4855 +def test_vrtmultidim_arraysource_array_constant(): + + ds = gdal.Open("data/vrt/arraysource_array_constant.vrt") + assert ds.GetRasterBand(1).ComputeRasterMinMax() == (10, 10) + + @pytest.mark.require_driver("netCDF") def test_vrtmultidim_arraysource_derivedarray_view(): diff --git a/frmts/vrt/data/gdalvrt.xsd b/frmts/vrt/data/gdalvrt.xsd index 397a7c0f17ee..90dbcf33670b 100644 --- a/frmts/vrt/data/gdalvrt.xsd +++ b/frmts/vrt/data/gdalvrt.xsd @@ -636,35 +636,41 @@ - - - - - - - - - - - - - - - + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + +