Skip to content

Commit

Permalink
Merge pull request #11077 from OSGeo/backport-11043-to-release/3.10
Browse files Browse the repository at this point in the history
[Backport release/3.10] DIMAP: for PNEO products, use the new color interpretations for the NIR, RedEdge and DeepBlue/Coastal bands
  • Loading branch information
rouault authored Oct 22, 2024
2 parents 0ba5ad6 + a183aff commit 75208d3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions autotest/gdrivers/dimap.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,14 @@ def test_dimap_2_vhr2020_ms_fs():
"Red Edge",
"Deep Blue",
]
assert [ds.GetRasterBand(i + 1).GetColorInterpretation() for i in range(6)] == [
gdal.GCI_RedBand,
gdal.GCI_GreenBand,
gdal.GCI_BlueBand,
gdal.GCI_NIRBand,
gdal.GCI_RedEdgeBand,
gdal.GCI_CoastalBand,
]
rgb_ds = gdal.Open("data/dimap2/vhr2020_ms_fs/MS-FS/IMG_RGB_R1C1.TIF")
ned_ds = gdal.Open("data/dimap2/vhr2020_ms_fs/MS-FS/IMG_NED_R1C1.TIF")
assert ds.ReadRaster() == rgb_ds.ReadRaster() + ned_ds.ReadRaster()
Expand Down
8 changes: 8 additions & 0 deletions frmts/dimap/dimapdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1400,23 +1400,31 @@ int DIMAPDataset::ReadImageInformation2()
}
case 4:
{
poBand->SetColorInterpretation(GCI_NIRBand);
poBand->SetDescription("NIR");
break;
}
case 5:
{
poBand->SetColorInterpretation(GCI_RedEdgeBand);
poBand->SetDescription("Red Edge");
break;
}
case 6:
{
poBand->SetColorInterpretation(GCI_CoastalBand);
poBand->SetDescription("Deep Blue");
break;
}
default:
break;
}
}
else if (l_nBands == 1 && osSpectralProcessing == "PAN")
{
poBand->SetColorInterpretation(GCI_PanBand);
poBand->SetDescription("Panchromatic");
}
SetBand(iBand, poBand);
}

Expand Down

0 comments on commit 75208d3

Please sign in to comment.