forked from OSGeo/gdal
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VRTProcessedDataset: allow to define a OutputBands element
to specify that the number of output bands of the VRT dataset and their type, either from the source dataset, deduced from the last step or from fixed values. Fixes OSGeo#11430
- Loading branch information
Showing
16 changed files
with
512 additions
and
29 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
autotest/gdrivers/data/vrt/processed_OutputBands_FROM_LAST_STEP.vrt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<VRTDataset subClass="VRTProcessedDataset"> | ||
<Input> | ||
<SourceFilename relativeToVRT="1">../byte.tif</SourceFilename> | ||
</Input> | ||
<OutputBands count="FROM_LAST_STEP" type="FROM_LAST_STEP"/> | ||
<ProcessingSteps> | ||
<Step name="Affine combination of band values"> | ||
<Algorithm>BandAffineCombination</Algorithm> | ||
<Argument name="coefficients_1">10,1</Argument> | ||
<Argument name="coefficients_2">20,1</Argument> | ||
</Step> | ||
</ProcessingSteps> | ||
</VRTDataset> |
31 changes: 31 additions & 0 deletions
31
autotest/gdrivers/data/vrt/processed_OutputBands_FROM_LAST_STEP_with_stats.vrt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<VRTDataset subClass="VRTProcessedDataset"> | ||
<Input> | ||
<SourceFilename relativeToVRT="1">../byte.tif</SourceFilename> | ||
</Input> | ||
<OutputBands count="FROM_LAST_STEP" type="FROM_LAST_STEP"/> | ||
<ProcessingSteps> | ||
<Step name="Affine combination of band values"> | ||
<Algorithm>BandAffineCombination</Algorithm> | ||
<Argument name="coefficients_1">10,1</Argument> | ||
<Argument name="coefficients_2">20,1</Argument> | ||
</Step> | ||
</ProcessingSteps> | ||
<VRTRasterBand dataType="Float64" band="1" subClass="VRTProcessedRasterBand"> | ||
<Metadata> | ||
<MDI key="STATISTICS_MINIMUM">84</MDI> | ||
<MDI key="STATISTICS_MAXIMUM">265</MDI> | ||
<MDI key="STATISTICS_MEAN">136.765</MDI> | ||
<MDI key="STATISTICS_STDDEV">22.928470838676</MDI> | ||
<MDI key="STATISTICS_VALID_PERCENT">100</MDI> | ||
</Metadata> | ||
</VRTRasterBand> | ||
<VRTRasterBand dataType="Float64" band="2" subClass="VRTProcessedRasterBand"> | ||
<Metadata> | ||
<MDI key="STATISTICS_MINIMUM">94</MDI> | ||
<MDI key="STATISTICS_MAXIMUM">275</MDI> | ||
<MDI key="STATISTICS_MEAN">146.765</MDI> | ||
<MDI key="STATISTICS_STDDEV">22.928470838676</MDI> | ||
<MDI key="STATISTICS_VALID_PERCENT">100</MDI> | ||
</Metadata> | ||
</VRTRasterBand> | ||
</VRTDataset> |
31 changes: 31 additions & 0 deletions
31
autotest/gdrivers/data/vrt/processed_OutputBands_FROM_LAST_STEP_with_stats_error.vrt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<VRTDataset subClass="VRTProcessedDataset"> | ||
<Input> | ||
<SourceFilename relativeToVRT="1">../byte.tif</SourceFilename> | ||
</Input> | ||
<OutputBands count="FROM_LAST_STEP" type="FROM_LAST_STEP"/> | ||
<ProcessingSteps> | ||
<Step name="Affine combination of band values"> | ||
<Algorithm>BandAffineCombination</Algorithm> | ||
<Argument name="coefficients_1">10,1</Argument> | ||
<Argument name="coefficients_3">20,1</Argument> | ||
</Step> | ||
</ProcessingSteps> | ||
<VRTRasterBand dataType="Float64" band="1" subClass="VRTProcessedRasterBand"> | ||
<Metadata> | ||
<MDI key="STATISTICS_MINIMUM">84</MDI> | ||
<MDI key="STATISTICS_MAXIMUM">265</MDI> | ||
<MDI key="STATISTICS_MEAN">136.765</MDI> | ||
<MDI key="STATISTICS_STDDEV">22.928470838676</MDI> | ||
<MDI key="STATISTICS_VALID_PERCENT">100</MDI> | ||
</Metadata> | ||
</VRTRasterBand> | ||
<VRTRasterBand dataType="Float64" band="2" subClass="VRTProcessedRasterBand"> | ||
<Metadata> | ||
<MDI key="STATISTICS_MINIMUM">94</MDI> | ||
<MDI key="STATISTICS_MAXIMUM">275</MDI> | ||
<MDI key="STATISTICS_MEAN">146.765</MDI> | ||
<MDI key="STATISTICS_STDDEV">22.928470838676</MDI> | ||
<MDI key="STATISTICS_VALID_PERCENT">100</MDI> | ||
</Metadata> | ||
</VRTRasterBand> | ||
</VRTDataset> |
23 changes: 23 additions & 0 deletions
23
autotest/gdrivers/data/vrt/processed_OutputBands_FROM_LAST_STEP_with_stats_missing_band.vrt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<VRTDataset subClass="VRTProcessedDataset"> | ||
<Input> | ||
<SourceFilename relativeToVRT="1">../byte.tif</SourceFilename> | ||
</Input> | ||
<OutputBands count="FROM_LAST_STEP" type="FROM_LAST_STEP"/> | ||
<ProcessingSteps> | ||
<Step name="Affine combination of band values"> | ||
<Algorithm>BandAffineCombination</Algorithm> | ||
<Argument name="coefficients_1">10,1</Argument> | ||
<Argument name="coefficients_2">20,1</Argument> | ||
</Step> | ||
</ProcessingSteps> | ||
<VRTRasterBand dataType="Float64" band="1" subClass="VRTProcessedRasterBand"> | ||
<Metadata> | ||
<MDI key="STATISTICS_MINIMUM">84</MDI> | ||
<MDI key="STATISTICS_MAXIMUM">265</MDI> | ||
<MDI key="STATISTICS_MEAN">136.765</MDI> | ||
<MDI key="STATISTICS_STDDEV">22.928470838676</MDI> | ||
<MDI key="STATISTICS_VALID_PERCENT">100</MDI> | ||
</Metadata> | ||
</VRTRasterBand> | ||
<!-- missing 2nd VRTRasterBand --> | ||
</VRTDataset> |
13 changes: 13 additions & 0 deletions
13
autotest/gdrivers/data/vrt/processed_OutputBands_FROM_SOURCE.vrt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<VRTDataset subClass="VRTProcessedDataset"> | ||
<Input> | ||
<SourceFilename relativeToVRT="1">../byte.tif</SourceFilename> | ||
</Input> | ||
<!-- default --> | ||
<OutputBands count="FROM_SOURCE" type="FROM_SOURCE"/> | ||
<ProcessingSteps> | ||
<Step name="Affine combination of band values"> | ||
<Algorithm>BandAffineCombination</Algorithm> | ||
<Argument name="coefficients_1">10,1</Argument> | ||
</Step> | ||
</ProcessingSteps> | ||
</VRTDataset> |
14 changes: 14 additions & 0 deletions
14
autotest/gdrivers/data/vrt/processed_OutputBands_FROM_SOURCE_wrong_band_count.vrt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<VRTDataset subClass="VRTProcessedDataset"> | ||
<Input> | ||
<SourceFilename relativeToVRT="1">../byte.tif</SourceFilename> | ||
</Input> | ||
<!-- default --> | ||
<OutputBands count="FROM_SOURCE" type="FROM_SOURCE"/> | ||
<ProcessingSteps> | ||
<Step name="Affine combination of band values"> | ||
<Algorithm>BandAffineCombination</Algorithm> | ||
<Argument name="coefficients_1">10,1</Argument> | ||
<Argument name="coefficients_2">20,1</Argument> | ||
</Step> | ||
</ProcessingSteps> | ||
</VRTDataset> |
12 changes: 12 additions & 0 deletions
12
autotest/gdrivers/data/vrt/processed_OutputBands_USER_PROVIDED.vrt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<VRTDataset subClass="VRTProcessedDataset"> | ||
<Input> | ||
<SourceFilename relativeToVRT="1">../byte.tif</SourceFilename> | ||
</Input> | ||
<OutputBands count="1" type="Float32"/> | ||
<ProcessingSteps> | ||
<Step name="Affine combination of band values"> | ||
<Algorithm>BandAffineCombination</Algorithm> | ||
<Argument name="coefficients_1">10,1</Argument> | ||
</Step> | ||
</ProcessingSteps> | ||
</VRTDataset> |
12 changes: 12 additions & 0 deletions
12
autotest/gdrivers/data/vrt/processed_OutputBands_USER_PROVIDED_invalid_type.vrt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<VRTDataset subClass="VRTProcessedDataset"> | ||
<Input> | ||
<SourceFilename relativeToVRT="1">../byte.tif</SourceFilename> | ||
</Input> | ||
<OutputBands count="1" type="invalid"/> | ||
<ProcessingSteps> | ||
<Step name="Affine combination of band values"> | ||
<Algorithm>BandAffineCombination</Algorithm> | ||
<Argument name="coefficients_1">10,1</Argument> | ||
</Step> | ||
</ProcessingSteps> | ||
</VRTDataset> |
12 changes: 12 additions & 0 deletions
12
autotest/gdrivers/data/vrt/processed_OutputBands_USER_PROVIDED_non_numeric_count.vrt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<VRTDataset subClass="VRTProcessedDataset"> | ||
<Input> | ||
<SourceFilename relativeToVRT="1">../byte.tif</SourceFilename> | ||
</Input> | ||
<OutputBands count="invalid" type="Float32"/> | ||
<ProcessingSteps> | ||
<Step name="Affine combination of band values"> | ||
<Algorithm>BandAffineCombination</Algorithm> | ||
<Argument name="coefficients_1">10,1</Argument> | ||
</Step> | ||
</ProcessingSteps> | ||
</VRTDataset> |
12 changes: 12 additions & 0 deletions
12
autotest/gdrivers/data/vrt/processed_OutputBands_USER_PROVIDED_too_large_count.vrt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<VRTDataset subClass="VRTProcessedDataset"> | ||
<Input> | ||
<SourceFilename relativeToVRT="1">../byte.tif</SourceFilename> | ||
</Input> | ||
<OutputBands count="100000000" type="Float32"/> | ||
<ProcessingSteps> | ||
<Step name="Affine combination of band values"> | ||
<Algorithm>BandAffineCombination</Algorithm> | ||
<Argument name="coefficients_1">10,1</Argument> | ||
</Step> | ||
</ProcessingSteps> | ||
</VRTDataset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.