Hi,
I'm working on a simple WPS process that subtracts one GridCoverage2D from
another (I hope this code shows up ok). But I can't seem to work out how to
have the SubtractFromConst and Add operations respect the NoData values in
the input GridCoverage2D. I've looked through the Javadocs for the
processors, but can't seem to find anything online. Can anyone suggest
anything I might be missing?
Thanks,
Owen
public GridCoverage2D execute(
@DescribeParameter(name = "coverageA", description = "First
input raster")
GridCoverage2D coverageA,
@DescribeParameter(name = "coverageB", description = "Second
input raster")
GridCoverage2D coverageB,
ProgressListener progressListener)
throws ProcessException {
BaseCoverageAlgebraProcess.checkCompatibleCoverages(coverageA,
coverageB);
final double[] constants = {0};
final ParameterValueGroup subParam =
PROCESSOR.getOperation("SubtractFromConst").getParameters();
subParam.parameter("source").setValue(coverageB);
subParam.parameter("constants").setValue(constants);
final ParameterValueGroup addParam =
PROCESSOR.getOperation("Add").getParameters();
addParam.parameter("source0").setValue(coverageA);
addParam.parameter("source1").setValue((GridCoverage2D)
PROCESSOR.doOperation(subParam));
return (GridCoverage2D) PROCESSOR.doOperation(addParam);
}
--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html
_______________________________________________
Geoserver-users mailing list
Please make sure you read the following two resources before posting to this
list:
- Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
If you want to request a feature or an improvement, also see this:
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users