* @param reader
* @throws IOException
*/
public void checkConsistency(GridCoverage2DReader reader) throws IOException {
GeneralEnvelope envelope = reader.getOriginalEnvelope();
GridEnvelope gridRange = reader.getOriginalGridRange();
CoordinateReferenceSystem crs = reader.getCoordinateReferenceSystem();
String[] metadataNames = reader.getMetadataNames();
Set<ParameterDescriptor<List>> dynamicParameters = reader.getDynamicParameters();
// Checking envelope equality
if (!envelope.equals(this.envelope, DELTA, true)) {
throw new IllegalArgumentException("The coverage envelope must be the same");
}
// Checking gridRange equality
final Rectangle thisRectangle = new Rectangle(this.gridRange.getLow(0),
this.gridRange.getLow(1), this.gridRange.getSpan(0), this.gridRange.getSpan(1));
final Rectangle thatRectangle = new Rectangle(gridRange.getLow(0), gridRange.getLow(1),
gridRange.getSpan(0), gridRange.getSpan(1));
if (!thisRectangle.equals(thatRectangle)) {
throw new IllegalArgumentException("The coverage gridRange should be the same");
}
// Checking dimensions