Skip to content

Commit

Permalink
Corrected Kanopus-V band order if not RGB
Browse files Browse the repository at this point in the history
  • Loading branch information
floeschau committed Dec 20, 2023
1 parent d8f02a5 commit 2f5e365
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,19 +272,19 @@
"file:size": 0,
"eo:bands": [
{
"name": "blue",
"common_name": "blue",
"description": "blue"
"name": "red",
"common_name": "red",
"description": "red"
},
{
"name": "green",
"common_name": "green",
"description": "green"
},
{
"name": "red",
"common_name": "red",
"description": "red"
"name": "blue",
"common_name": "blue",
"description": "blue"
},
{
"name": "nir",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,19 +264,19 @@
"file:size": 0,
"eo:bands": [
{
"name": "blue",
"common_name": "blue",
"description": "blue"
"name": "red",
"common_name": "red",
"description": "red"
},
{
"name": "green",
"common_name": "green",
"description": "green"
},
{
"name": "red",
"common_name": "red",
"description": "red"
"name": "blue",
"common_name": "blue",
"description": "blue"
},
{
"name": "nir",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,19 @@
"file:size": 0,
"eo:bands": [
{
"name": "blue",
"common_name": "blue",
"description": "blue"
"name": "red",
"common_name": "red",
"description": "red"
},
{
"name": "green",
"common_name": "green",
"description": "green"
},
{
"name": "red",
"common_name": "red",
"description": "red"
"name": "blue",
"common_name": "blue",
"description": "blue"
},
{
"name": "nir",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,19 @@
"file:size": 0,
"eo:bands": [
{
"name": "blue",
"common_name": "blue",
"description": "blue"
"name": "red",
"common_name": "red",
"description": "red"
},
{
"name": "green",
"common_name": "green",
"description": "green"
},
{
"name": "red",
"common_name": "red",
"description": "red"
"name": "blue",
"common_name": "blue",
"description": "blue"
},
{
"name": "nir",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1144,19 +1144,19 @@
"file:size": 0,
"eo:bands": [
{
"name": "blue",
"common_name": "blue",
"description": "blue"
"name": "red",
"common_name": "red",
"description": "red"
},
{
"name": "green",
"common_name": "green",
"description": "green"
},
{
"name": "red",
"common_name": "red",
"description": "red"
"name": "blue",
"common_name": "blue",
"description": "blue"
},
{
"name": "nir",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,19 +392,19 @@
"file:size": 1,
"eo:bands": [
{
"name": "blue",
"common_name": "blue",
"description": "blue"
"name": "red",
"common_name": "red",
"description": "red"
},
{
"name": "green",
"common_name": "green",
"description": "green"
},
{
"name": "red",
"common_name": "red",
"description": "red"
"name": "blue",
"common_name": "blue",
"description": "blue"
},
{
"name": "nir",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,14 @@ private StacAsset GetBandAsset(StacItem stacItem, string name, IAsset asset, Kan
eoarr[i] = new EoBandObject("nir", EoBandCommonName.nir);
eoarr[i].Properties.Add("description", "nir");
}

}
// Swap bands 1 and 3 (red and blue) if the channels are not in RGB order in the metadata
if (numberOfChannels >= 3 && eoarr[0].CommonName == EoBandCommonName.blue && eoarr[2].CommonName == EoBandCommonName.red)
{
(eoarr[2], eoarr[0]) = (eoarr[0], eoarr[2]);
}
stacAsset.EoExtension().Bands = eoarr;

}
else if (name == "PAN")
{
Expand Down

0 comments on commit 2f5e365

Please sign in to comment.