Mosaicking different granules, some having nodata defined and some not, may throw a NPE when computing a tile not intersecting all the sources.
These are the findings based on an example made of 3 granules where:
source0 and source1 has nodata defined whilst source2 doesn't.
source1 is displaced in such a way that it will no contribute to tile 0,0.
The boolean hasNodata Flags get therefore initialized like this:
hasNodata[0] = true
hasNodata[1] = true
hasNodata[2] = false
When computing the first Tile [x=0,y=0], sources[1] will get skipped so only sources[0] and sources[2] will contribute to the result and get used.
Using initialized hasNodata array with old numbering results into inconsistent information trying to access the nodataRange of the second image which was actually not available, resulting into a NPE.
Mosaicking different granules, some having nodata defined and some not, may throw a NPE when computing a tile not intersecting all the sources.
These are the findings based on an example made of 3 granules where: source0 and source1 has nodata defined whilst source2 doesn't. source1 is displaced in such a way that it will no contribute to tile 0,0.
The boolean hasNodata Flags get therefore initialized like this: hasNodata[0] = true hasNodata[1] = true hasNodata[2] = false
When computing the first Tile [x=0,y=0], sources[1] will get skipped so only sources[0] and sources[2] will contribute to the result and get used. Using initialized hasNodata array with old numbering results into inconsistent information trying to access the nodataRange of the second image which was actually not available, resulting into a NPE.