Revision 875 org.gvsig.raster.tools/trunk/org.gvsig.raster.tools/org.gvsig.raster.tools.app/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/ClippingProcess.java

View differences:

ClippingProcess.java
75 75
	private AffineTransform               affineTransform     = new AffineTransform();
76 76
	private boolean                       oneLayerPerBand     = false;
77 77
	private int[]                         drawableBands       = { 0, 1, 2 };
78
	private int[]                         pValues             = null;
78
	private double[]                      pValues             = null;
79 79
	private RasterWriter                  rw                  = null;
80 80
	private int                           interpolationMethod = Buffer.INTERPOLATION_Undefined;
81 81
	private String                        viewName            = "";
......
115 115
		fileName = getStringParam("filename");
116 116
		writerBufferServer = (DataServerWriter) getParam("datawriter");
117 117
		viewName = getStringParam("viewname");
118
		pValues = getIntArrayParam("pixelcoordinates");
118
		pValues = getDoubleArrayParam("pixelcoordinates");
119 119
		wcValues = getDoubleArrayParam("realcoordinates");
120 120
		rasterSE = (FLyrRaster)getLayerParam("layer");
121 121
		drawableBands = getIntArrayParam("drawablebands");
......
218 218
						if(pValues != null) {
219 219
							if (util.isBufferTooBig(new double[] { pValues[0], pValues[3], pValues[2], pValues[1] }, drawableBands.length))
220 220
								query.setReadOnly(true);
221
							query.setAreaOfInterest(pValues[0], pValues[3], pValues[2] - pValues[0], pValues[1] - pValues[3]);
221
							query.setAreaOfInterest((int)pValues[0], (int)pValues[1], (int)Math.abs(pValues[2] - pValues[0]) + 1, (int)Math.abs(pValues[3] - pValues[1]) + 1);
222 222
						} else if(wcValues != null) {
223 223
							query.setReadOnly(true);
224 224
							query.setAreaOfInterest(wcValues[0], wcValues[1], Math.abs(wcValues[0] - wcValues[2]), Math.abs(wcValues[1] - wcValues[3]));
......
237 237
						if (util.isBufferTooBig(new double[] { 0, 0, resolutionWidth, resolutionHeight }, drawableBands.length))
238 238
							query.setReadOnly(true);
239 239
						if(pValues != null) 
240
							query.setAreaOfInterest(pValues[0], pValues[3], Math.abs(pValues[2] - pValues[0]) + 1, Math.abs(pValues[1] - pValues[3]) + 1, resolutionWidth, resolutionHeight);
240
							query.setAreaOfInterest((int)pValues[0], (int)pValues[3], (int)Math.abs(pValues[2] - pValues[0]) + 1, (int)Math.abs(pValues[1] - pValues[3]) + 1, resolutionWidth, resolutionHeight);
241 241
						else if(wcValues != null) {
242 242
							Extent bbox = RasterLocator.getManager().getDataStructFactory().createExtent(wcValues[0], wcValues[1], wcValues[2], wcValues[3]);
243 243
							query.setAreaOfInterest(bbox, resolutionWidth, resolutionHeight);
......
256 256
					int despX = 0;
257 257
					int despY = 0;
258 258
					if (pValues != null){
259
						despX = pValues[0];
260
						despY = pValues[1];
259
						despX = (int)pValues[0];
260
						despY = (int)pValues[1];
261 261
					} else if (wcValues != null){
262 262
						despX = (int)dstoreCopy.worldToRaster(new Point2D.Double(wcValues[0], wcValues[1])).getX();
263 263
						despY = (int)dstoreCopy.worldToRaster(new Point2D.Double(wcValues[0], wcValues[1])).getY();

Also available in: Unified diff