Skip to main content

Hello,

I have one raster who's extent is smaller than another, but I would like to subtract one from another with the resulting raster the same extent as the smaller one.

I get this error when using the RasterCellValueCalculator to subtract them:

 

RasterCellValueCalculator_Evaluator(RasterEvaluationFactory): Raster A has '12392' rows and '4022' columns, whereas raster B has '12435' rows and '4065' columns. Paired rasters must have the same dimensions

They are both 1 m cell size.

Thanks!

Sean

When working with the rasterExpressionEvaluator, the rasters needs to have identical properties.

 

Make sure both rasters are in the same projection.

 

On the smaller raster use a RasterPropertyExtractor and then Clip the larger raster by the smaller with merge attributes checked.

 

 

The larger raster now covers the same areas as the smaller raster, but does not necessarily have the same dimensions. If necessary, use a Resampler and set the number of rows and columns to the _num_rows and _num_columns attributes. If necessary use a RasterGeoreferencer in extents modes, setting on the coordinates from the corresponding attributes.

Your rasters should now be perfectly aligned and can be used in the RasterExpressionEvaluator and also the RasterBandCombiner.


Reply