Skip to content

Commit

Permalink
Fix mistake in testing
Browse files Browse the repository at this point in the history
  • Loading branch information
iGN5117 committed Aug 9, 2023
1 parent f9f776d commit 5d7082f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,23 @@ public void testAddBandAsArrayAppend()
assertEquals(RasterAccessors.srid(raster), RasterAccessors.srid(rasterWithBand1));

//replace the first band with a customNoDataValue
rasterWithBand1 = MapAlgebra.addBandFromArray(raster, band1, 1, -999d);
rasterWithBand1 = MapAlgebra.addBandFromArray(rasterWithBand1, band1, 1, -999d);
assertEquals(1, RasterAccessors.numBands(rasterWithBand1));
assertEquals(raster.getEnvelope(), rasterWithBand1.getEnvelope());
assertEquals(raster.getCoordinateReferenceSystem2D(), rasterWithBand1.getCoordinateReferenceSystem2D());
assertEquals(RasterAccessors.srid(raster), RasterAccessors.srid(rasterWithBand1));
assertEquals(-999, rasterWithBand1.getSampleDimension(0).getNoDataValues()[0], 1e-9);

//replace first band with a different customNoDataValue
rasterWithBand1 = MapAlgebra.addBandFromArray(raster, band1, 1, -9999d);
rasterWithBand1 = MapAlgebra.addBandFromArray(rasterWithBand1, band1, 1, -9999d);
assertEquals(1, RasterAccessors.numBands(rasterWithBand1));
assertEquals(raster.getEnvelope(), rasterWithBand1.getEnvelope());
assertEquals(raster.getCoordinateReferenceSystem2D(), rasterWithBand1.getCoordinateReferenceSystem2D());
assertEquals(RasterAccessors.srid(raster), RasterAccessors.srid(rasterWithBand1));
assertEquals(-9999, rasterWithBand1.getSampleDimension(0).getNoDataValues()[0], 1e-9);

//remove noDataValue from the first band
rasterWithBand1 = MapAlgebra.addBandFromArray(raster, band1, 1, null);
rasterWithBand1 = MapAlgebra.addBandFromArray(rasterWithBand1, band1, 1, null);
assertEquals(1, RasterAccessors.numBands(rasterWithBand1));
assertEquals(raster.getEnvelope(), rasterWithBand1.getEnvelope());
assertEquals(raster.getCoordinateReferenceSystem2D(), rasterWithBand1.getCoordinateReferenceSystem2D());
Expand Down

0 comments on commit 5d7082f

Please sign in to comment.