From: S D. <sd...@ja...> - 2010-06-30 14:24:49
|
I am trying to Scale a Grid Coverage and it seems like the 'Scale' Operation doesn't work the way I thought it would. The new GridCoverage Object is the exact same size as the GridCoverage object before we do the operation. Here is my source code to simply scale an image 1.5 times in both the X and Y direction: final AbstractProcessor processor = new DefaultProcessor(null); final ParameterValueGroup param = processor.getOperation("Scale").getParameters(); param.parameter("source").setValue(originalGridCoverage); //a GridCoverage2D object param.parameter("xTrans").setValue(0.0D); param.parameter("yTrans").setValue(0.0D); param.parameter("xScale").setValue(1.5D); param.parameter("yScale").setValue(1.5D); movedImage = (GridCoverage2D) processor.doOperation(param); //the movedImage object is a GridCoverage2D object. In the end, the movedImage object has the exact same dimensions as the originalGridCoverage object. Also, nothing resizes on my map like I'd expect. I was able to perform translations just fine by setting the x and yTrans variables, it is the scaling that has be stumped. Any suggestions on what I may be doing wrong? Thanks in advance! Spencer -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Resize-a-GridCoverage-Object-tp5237788p5237788.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. |