File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222#include " gdalalg_vector_read.h"
2323#include " gdalalg_tee.h"
2424
25+ #include " vrtdataset.h"
26+
2527#include < algorithm>
2628#include < cassert>
2729
@@ -1567,6 +1569,9 @@ std::string GDALAbstractPipelineAlgorithm::BuildNestedPipeline(
15671569 curAlg->m_oMapDatasetNameToDataset [datasetNameOut] = poDS;
15681570
15691571 poDS->SetDescription (argsStr.c_str ());
1572+ auto poVRTDataset = dynamic_cast <VRTDataset *>(poDS);
1573+ if (poVRTDataset)
1574+ poVRTDataset->SetWritable (false );
15701575 }
15711576
15721577 m_apoNestedPipelines.emplace_back (std::move (nestedPipeline));
Original file line number Diff line number Diff line change @@ -835,6 +835,18 @@ def test_gdalalg_pipeline_nested_nominal():
835835 ]
836836
837837
838+ def test_gdalalg_pipeline_inner_pipeline_vrt (tmp_path ):
839+ """Test bugfix for https://github.com/OSGeo/gdal/issues/14732"""
840+
841+ shutil .copy ("data/color_file.txt" , tmp_path )
842+
843+ with gdal .alg .pipeline (
844+ pipeline = f"read ../gcore/data/byte.tif ! blend --overlay [ read ../gcore/data/byte.tif ! color-map --color-map { tmp_path } /color_file.txt ]"
845+ ) as alg :
846+ ds = alg .Output ()
847+ assert ds .GetRasterBand (1 ).Checksum () == 4475
848+
849+
838850def test_gdalalg_pipeline_nested_serialize_to_gdalg (tmp_vsimem ):
839851
840852 out_filename = tmp_vsimem / "out.gdalg.json"
You can’t perform that action at this time.
0 commit comments