Revision 20128

View differences:

trunk/libraries/libRaster/src/org/gvsig/raster/grid/roi/ROIStatistic.java
73 73
		int oldBandToOperate = bandToOperate;
74 74
		statisticsCalculated = true;
75 75
		
76
		for (x = 0; x < roi.getNX(); x++){
76
		for (int iBand = 0; iBand < bandCount; iBand++) {
77
			roi.setBandToOperate(iBand);
77 78
			for (y = 0; y < roi.getNY(); y++){
78
				for (int iBand = 0; iBand < bandCount; iBand++) {
79
					roi.setBandToOperate(iBand);
79
				for (x = 0; x < roi.getNX(); x++){
80 80
					z = getValue(x, y);
81 81
					if(!roi.isNoDataValue(z))	{
82 82
						if( values[iBand] == 0 )
trunk/extensions/extRemoteSensing/src/org/gvsig/remotesensing/scatterplot/gui/ChartScaterPlotPanel.java
226 226
		data= new float[2][width*height];
227 227
			
228 228
		if (dataGrid.getDataType()== IBuffer.TYPE_BYTE){
229
			for(int i=0; i<width;i++){
230
				for(int j=0; j<height; j++){
231
					data[0][indice]= dataGrid.getRasterBuf().getElemByte(j,i,0)&0xff;
232
					data[1][indice]= dataGrid.getRasterBuf().getElemByte(j,i,1)&0xff;
229
			for(int j=0; j<height; j++){
230
				for(int i=0; i<width;i++){
231
					data[0][indice]= dataGrid.getRasterBuf().getElemByte(j, i, 0) & 0xff;
232
					data[1][indice]= dataGrid.getRasterBuf().getElemByte(j, i, 1) & 0xff;
233 233
					indice++;
234 234
				}	
235 235
			}
236 236
		}
237 237
			
238 238
		if (dataGrid.getDataType()== IBuffer.TYPE_SHORT){
239
				
240
			for(int i=0; i<width;i++){
241
				for(int j=0; j<height; j++){
242
					data[0][indice]= dataGrid.getRasterBuf().getElemShort(j,i,0);
243
					data[1][indice]= dataGrid.getRasterBuf().getElemShort(j,i,1);
239
			for(int j=0; j<height; j++){
240
				for(int i=0; i<width;i++){
241
					data[0][indice]= dataGrid.getRasterBuf().getElemShort(j, i, 0);
242
					data[1][indice]= dataGrid.getRasterBuf().getElemShort(j, i, 1);
244 243
					indice++;
245 244
				}
246 245
			}
247 246
		}
248 247
			
249 248
		if (dataGrid.getDataType()== IBuffer.TYPE_INT){
250
				
251
			for(int i=0; i<width;i++){
252
				for(int j=0; j<height; j++){
253
					data[0][indice]= dataGrid.getRasterBuf().getElemInt(j,i,0);
254
					data[1][indice]= dataGrid.getRasterBuf().getElemInt(j,i,1);
249
			for(int j=0; j<height; j++){
250
				for(int i=0; i<width;i++){
251
					data[0][indice]= dataGrid.getRasterBuf().getElemInt(j, i, 0);
252
					data[1][indice]= dataGrid.getRasterBuf().getElemInt(j, i, 1);
255 253
					indice++;
256 254
				}	
257 255
			}
258 256
		}
259 257
		
260 258
		if (dataGrid.getDataType()== IBuffer.TYPE_FLOAT){
261
			for(int i=0; i<width;i++){
262
				for(int j=0; j<height; j++){
263
					data[0][indice]= dataGrid.getRasterBuf().getElemFloat(j,i,0);
264
					data[1][indice]= dataGrid.getRasterBuf().getElemFloat(j,i,1);
259
			for(int j=0; j<height; j++){
260
				for(int i=0; i<width;i++){
261
					data[0][indice]= dataGrid.getRasterBuf().getElemFloat(j, i, 0);
262
					data[1][indice]= dataGrid.getRasterBuf().getElemFloat(j, i, 1);
265 263
					indice++;
266 264
				}
267 265
			}
268 266
		}
269 267
		// OJO AL CASTINTG DE DOUBLE A FLOAT
270 268
		if (dataGrid.getDataType()== IBuffer.TYPE_DOUBLE){
271
			for(int i=0; i<width;i++){
272
				for(int j=0; j<height; j++){
273
					data[0][indice]= (float)dataGrid.getRasterBuf().getElemDouble(j,i,0);
274
					data[1][indice]= (float)dataGrid.getRasterBuf().getElemDouble(j,i,1);
269
			for(int j=0; j<height; j++){
270
				for(int i=0; i<width;i++){
271
					data[0][indice]= (float)dataGrid.getRasterBuf().getElemDouble(j, i, 0);
272
					data[1][indice]= (float)dataGrid.getRasterBuf().getElemDouble(j, i, 1);
275 273
					indice++;
276 274
				}
277 275
			}

Also available in: Unified diff