Revision 11396

View differences:

trunk/extensions/extRasterTools-SE/config/text.properties
19 19
file=Archivo
20 20
formato=Formato
21 21
general_info=Informaci?n del dataset
22
generando_bloque=Generando bloque
23
generando_recorte=Generando recorte
22 24
georref=Georreferenciado
23 25
height=Alto
26
incremento_recorte=Porcentaje del proceso
24 27
info=Info
25 28
lineal_directo=Lineal directo
26 29
linf_der=Inf Der
trunk/libraries/libRaster/src-test/org/gvsig/raster/dataset/TestStatisticMultiFile.java
86 86
			dataTestB2(grmf.getStatistics());
87 87
			dataTestB3(grmf.getStatistics());
88 88
			//print(grmf);
89
		} catch (FileFoundInListException e) {
89
		} catch (FileNotFoundInListException e) {
90 90
			e.printStackTrace();
91 91
		}
92 92
	}
trunk/libraries/libRaster/src-test/org/gvsig/raster/dataset/io/rmf/TestRmfWrite.java
32 32
import org.gvsig.raster.RasterLibrary;
33 33
import org.gvsig.raster.buffer.BufferFactory;
34 34
import org.gvsig.raster.dataset.FileNotOpenException;
35
import org.gvsig.raster.dataset.InvalidSetViewException;
35 36
import org.gvsig.raster.dataset.NotSupportedExtensionException;
36 37
import org.gvsig.raster.dataset.RasterDataset;
37 38
import org.gvsig.raster.dataset.RasterDriverException;
......
75 76
			return;
76 77
		}
77 78
		BufferFactory ds = new BufferFactory(f);
78
		ds.setAreaOfInterest();
79
		try {
80
			ds.setAreaOfInterest();
81
		} catch (InvalidSetViewException e1) {
82
			e1.printStackTrace();
83
		}
79 84
		
80 85
		try {
81 86
			histogram = f.getHistogram().getHistogram();
trunk/libraries/libRaster/src-test/org/gvsig/raster/dataset/TestIOMemoryRasterDriver.java
85 85
				Band band = new Band(f.getFName(), i, f.getDataType());
86 86
				band.setPositionToDrawInBuffer(i);
87 87
				bandList.addBand(band, i);
88
			}catch(BandFoundInListException ex){
88
			}catch(BandNotFoundInListException ex){
89 89
				//No a?adimos la banda
90 90
			}
91 91
		}
......
96 96
		//Prueba getWindowRaster(int x, int y, int w, int h, BandList bandList, IBuffer rasterBuf)
97 97
		
98 98
		//COMPLETA
99
		IBuffer buffer = RasterBuffer.getBuffer(f.getDataType(), 25, 24, 3, true, null);
99
		IBuffer buffer = RasterBuffer.getBuffer(f.getDataType(), 25, 24, 3, true);
100 100
		f.getWindowRaster(0, 0, 25, 24, bandList, buffer);
101 101
		dataTest1(buffer);
102 102
		
103 103
		//ZOOM
104
		buffer = RasterBuffer.getBuffer(f.getDataType(), 2, 2, 3, true, null);
104
		buffer = RasterBuffer.getBuffer(f.getDataType(), 2, 2, 3, true);
105 105
		f.getWindowRaster(10, 10, 2, 2, bandList, buffer);
106 106
		dataTest2(buffer);
107 107
		
......
109 109
		//Prueba de getWindowRaster(double minX, double minY, double maxX, double maxY, int bufWidth, int bufHeight, BandList bandList, IBuffer rasterBuf, boolean adjustToExtent)
110 110
		
111 111
		//EXTENT COMPLETO
112
		buffer = RasterBuffer.getBuffer(f.getDataType(), 25, 24, 3, true, null);
112
		buffer = RasterBuffer.getBuffer(f.getDataType(), 25, 24, 3, true);
113 113
		f.getWindowRaster(f.getExtent().minX(),
114 114
							f.getExtent().minY(),
115 115
							f.getExtent().maxX(),
......
118 118
		dataTest1(buffer);
119 119
			
120 120
		//ZOOM + subsampling
121
		buffer = RasterBuffer.getBuffer(f.getDataType(), 8, 8, 3, true, null);
121
		buffer = RasterBuffer.getBuffer(f.getDataType(), 8, 8, 3, true);
122 122
		f.getWindowRaster(	Math.ceil(f.getExtent().minX()),
123 123
							Math.ceil(f.getExtent().minY()),
124 124
							Math.floor(f.getExtent().maxX()),
......
127 127
		dataTest3(buffer);
128 128
		
129 129
		//ZOOM + supersampling
130
		buffer = RasterBuffer.getBuffer(f.getDataType(), 20, 20, 3, true, null);
130
		buffer = RasterBuffer.getBuffer(f.getDataType(), 20, 20, 3, true);
131 131
		f.getWindowRaster(	Math.ceil(f.getExtent().minX()),
132 132
							Math.ceil(f.getExtent().minY()),
133 133
							Math.floor(f.getExtent().minX() + 10),
......
139 139
		//Prueba de getWindowRaster(double x, double y, double w, double h, BandList bandList, IBuffer rasterBuf, boolean adjustToExtent)
140 140
		
141 141
		//COMPLETA
142
		buffer = RasterBuffer.getBuffer(f.getDataType(), 25, 24, 3, true, null);
142
		buffer = RasterBuffer.getBuffer(f.getDataType(), 25, 24, 3, true);
143 143
		f.getWindowRaster(	f.getExtent().minX(),
144 144
							f.getExtent().maxY(),
145 145
							f.getExtent().width(),
......
151 151
		//Prueba de getWindowRaster(int x, int y, int w, int h, int bufWidth, int bufHeight, BandList bandList, IBuffer rasterBuf)
152 152
		
153 153
		//COMPLETA
154
		buffer = RasterBuffer.getBuffer(f.getDataType(), 5, 5, 3, true, null);
154
		buffer = RasterBuffer.getBuffer(f.getDataType(), 5, 5, 3, true);
155 155
		f.getWindowRaster(0, 0, 25, 24, 5, 5, bandList, buffer);
156 156
		dataTest4(buffer);
157 157
		
trunk/libraries/libRaster/src-test/org/gvsig/raster/buffer/cache/TestRasterReadOnlyHugeBuffer.java
30 30

  
31 31
import org.gvsig.raster.RasterLibrary;
32 32
import org.gvsig.raster.buffer.BufferFactory;
33
import org.gvsig.raster.dataset.FileNotExistsException;
33 34
import org.gvsig.raster.dataset.IBuffer;
35
import org.gvsig.raster.dataset.InvalidSetViewException;
34 36
import org.gvsig.raster.dataset.NotSupportedExtensionException;
35 37
import org.gvsig.raster.dataset.RasterDataset;
36 38
import org.gvsig.raster.dataset.RasterDriverException;
37 39

  
38 40
/**
41
 * Test para la prueba de buffer de solo lectura.
39 42
 * 
40
 * 
41 43
 * @author Nacho Brodin (nachobrodin@gmail.com)
42 44
 */
43 45
public class TestRasterReadOnlyHugeBuffer extends TestCase {
......
81 83
		RasterLibrary.pageSize = 0.2;
82 84
		
83 85
		try {
84
			bufCache = new RasterReadOnlyHugeBuffer(IBuffer.TYPE_BYTE, 870, 870, 3, path);
86
			bufCache = new RasterReadOnlyHugeBuffer(IBuffer.TYPE_BYTE, 870, 870, 3);
87
			if(bufCache instanceof RasterReadOnlyHugeBuffer) 
88
				((RasterReadOnlyHugeBuffer)bufCache).setBufferParams(path, 0, 0, f.getWidth(), f.getHeight());
89
						
85 90
		} catch (FileNotFoundException e) {
86 91
			e.printStackTrace();
87 92
		} catch (NotSupportedExtensionException e) {
88 93
			e.printStackTrace();
89 94
		} catch (RasterDriverException e) {
90 95
			e.printStackTrace();
96
		} catch (FileNotExistsException e) {
97
			e.printStackTrace();
98
		} catch (InvalidSetViewException e) {
99
			e.printStackTrace();
91 100
		}
92 101
	}
93 102
	
trunk/libraries/libRaster/src-test/org/gvsig/raster/buffer/cache/TestReadOnlyCache.java
7 7
import org.gvsig.raster.RasterLibrary;
8 8
import org.gvsig.raster.buffer.BufferFactory;
9 9
import org.gvsig.raster.buffer.RasterBuffer;
10
import org.gvsig.raster.dataset.FileNotExistsException;
10 11
import org.gvsig.raster.dataset.IBuffer;
12
import org.gvsig.raster.dataset.InvalidSetViewException;
11 13
import org.gvsig.raster.dataset.NotSupportedExtensionException;
12 14
import org.gvsig.raster.dataset.RasterDataset;
13 15
import org.gvsig.raster.dataset.RasterDriverException;
......
46 48
	
47 49
	public void testStack() {
48 50
		try {
49
			cache = new RasterReadOnlyHugeBuffer(f.getDataType(), f.getWidth(), f.getHeight(), f.getBandCount(), path);
51
			cache = new RasterReadOnlyHugeBuffer(f.getDataType(), f.getWidth(), f.getHeight(), f.getBandCount());
52
			if(cache instanceof RasterReadOnlyHugeBuffer) {
53
				try {
54
					((RasterReadOnlyHugeBuffer)cache).setBufferParams(path, 0, 0, f.getWidth(), f.getHeight());
55
				} catch (InvalidSetViewException e) {
56
					e.printStackTrace();
57
				} catch (FileNotExistsException e) {
58
					e.printStackTrace();
59
				}
60
			}
50 61
			
51 62
			int[] drawableBands = {0, 1, 2};
52 63
			
trunk/libraries/libRaster/src-test/org/gvsig/raster/buffer/TDSIntBufferGdal.java
22 22

  
23 23
import org.gvsig.raster.RasterLibrary;
24 24
import org.gvsig.raster.dataset.IBuffer;
25
import org.gvsig.raster.dataset.InvalidSetViewException;
25 26
import org.gvsig.raster.dataset.NotSupportedExtensionException;
26 27
import org.gvsig.raster.dataset.RasterDataset;
27 28
import org.gvsig.raster.dataset.RasterDriverException;
......
72 73
		}
73 74
		ds = new BufferFactory(f);
74 75
		ds.addDrawableBands(drawableBands);
75
		ds.setAreaOfInterest(0, 0, 25, 24, 5, 5);
76
		try {
77
			ds.setAreaOfInterest(0, 0, 25, 24, 5, 5);
78
		} catch (InvalidSetViewException e) {
79
			e.printStackTrace();
80
		}
76 81
		dataTest1();
77 82
		//print();
78 83
		
79
		ds.setAreaOfInterest(5, 5, 15, 15, 3, 3);
84
		try {
85
			ds.setAreaOfInterest(5, 5, 15, 15, 3, 3);
86
		} catch (InvalidSetViewException e) {
87
			e.printStackTrace();
88
		}
80 89
		dataTest2();
81 90
		//print();
82 91
	}
trunk/libraries/libRaster/src/org/gvsig/raster/buffer/BufferFactory.java
21 21

  
22 22
import java.awt.geom.Point2D;
23 23

  
24
import org.gvsig.raster.dataset.FileFoundInListException;
24
import org.gvsig.raster.dataset.FileNotFoundInListException;
25 25
import org.gvsig.raster.dataset.IBuffer;
26
import org.gvsig.raster.dataset.InvalidSetViewException;
26 27
import org.gvsig.raster.dataset.NotSupportedExtensionException;
27 28
import org.gvsig.raster.dataset.RasterDataset;
28 29
import org.gvsig.raster.dataset.RasterDriverException;
......
116 117
			mDataset.addDataset(grf);
117 118
			width = grf.getWidth();
118 119
			height = grf.getHeight();
119
		}catch(FileFoundInListException e) {
120
		}catch(FileNotFoundInListException e) {
120 121
			//El fichero est? en la lista por lo que no lo a?adimos
121 122
		}
122 123
	}
......
132 133
			mDataset.addDataset(filename);
133 134
			width = (int)mDataset.getWidth()[0];
134 135
			height = (int)mDataset.getHeight()[0];
135
		}catch(FileFoundInListException e) {
136
		}catch(FileNotFoundInListException e) {
136 137
			//El fichero est? en la lista por lo que no lo a?adimos
137 138
		}
138 139
	}
......
258 259
	 * @param adjustToExtent Flag que dice si el extent solicitado debe ajustarse al extent del raster o no.
259 260
	 * @throws ArrayIndexOutOfBoundsException
260 261
	 */
261
	public void setAreaOfInterest(double x, double y, double w, double h, boolean adjustToExtent) throws ArrayIndexOutOfBoundsException{
262
	public void setAreaOfInterest(double x, double y, double w, double h, boolean adjustToExtent) 
263
		throws ArrayIndexOutOfBoundsException {
262 264
		dataExtent = new Extent(x, y, x + w, y - h);
263 265
		if(adjustToExtent) {
264 266
			Extent adjustedDataExtent = RasterUtilities.calculateAdjustedView(dataExtent, mDataset.getExtent());
......
269 271
				newW = (adjustedDataExtent.width() * w) / dataExtent.width();  
270 272
				newH = (adjustedDataExtent.height() * h) / dataExtent.height();
271 273
			}
272
			rasterBuf = mDataset.getWindowRaster(adjustedDataExtent.getMin().getX(), adjustedDataExtent.getMax().getY(), newW, newH, adjustToExtent);
273
		}else
274
			rasterBuf = mDataset.getWindowRaster(dataExtent.getMin().getX(), dataExtent.getMax().getY(), w, h, adjustToExtent);
274
			try {
275
				rasterBuf = mDataset.getWindowRaster(adjustedDataExtent.getMin().getX(), adjustedDataExtent.getMax().getY(), newW, newH, adjustToExtent);
276
			} catch (InvalidSetViewException e) {
277
				//Esta excepci?n no debe darse ya que se hace un calculateAdjustedView antes de la llamada.
278
			}
279
		} else {
280
			try {
281
				rasterBuf = mDataset.getWindowRaster(dataExtent.getMin().getX(), dataExtent.getMax().getY(), w, h, adjustToExtent);
282
			} catch (InvalidSetViewException e) {
283
				//Esta excepci?n no debe darse ya que se hace un calculateAdjustedView antes de la llamada.
284
			}
285
		}
275 286
	}
276 287
		
277 288
	/**
......
288 299
	 * un array de dos elementos que representan el desplazamiento en pixels de X e Y de la esquina superior izquierda. 
289 300
	 * @throws ArrayIndexOutOfBoundsException
290 301
	 */
291
	public int[] setAreaOfInterest(double minX, double minY, double maxX, double maxY, int bufWidth, int bufHeight, boolean adjustToExtent) throws ArrayIndexOutOfBoundsException{
302
	public int[] setAreaOfInterest(double minX, double minY, double maxX, double maxY, int bufWidth, int bufHeight, boolean adjustToExtent) 
303
		throws ArrayIndexOutOfBoundsException {
292 304
		//TODO: VALIDACI?N: Comprobaci?n de exceso de memoria reservada
293 305
		dataExtent = new Extent(minX, minY, maxX, maxY);
294 306
		Extent adjustedDataExtent = new Extent(dataExtent);
......
306 318
			nHeight = ((adjustedDataExtent.height() * mDataset.getDataset(0).getHeight()) / mDataset.getDataset(0).getExtent().height());
307 319

  
308 320
			if(bufWidth > Math.ceil(nWidth) && bufHeight > Math.ceil(nHeight)) {				
309
				rasterBuf = mDataset.getWindowRaster(minX, maxY, Math.abs(maxX - minX), Math.abs(maxY - minY), adjustToExtent);
321
				try {
322
					rasterBuf = mDataset.getWindowRaster(minX, maxY, Math.abs(maxX - minX), Math.abs(maxY - minY), adjustToExtent);
323
				} catch (InvalidSetViewException e) {
324
					//Esta excepci?n no debe darse ya que se hace un calculateAdjustedView antes de la llamada.
325
				}
310 326
				int[] step = mDataset.calcSteps(minX, maxY, maxX, minY, nWidth, nHeight, bufWidth, bufHeight);
311 327
				return step;
312 328
			}
313 329
		}
314 330
		
315
		rasterBuf = mDataset.getWindowRaster(minX, minY, maxX, maxY, bufWidth, bufHeight, adjustToExtent);
331
		try {
332
			rasterBuf = mDataset.getWindowRaster(minX, minY, maxX, maxY, bufWidth, bufHeight, adjustToExtent);
333
		} catch (InvalidSetViewException e) {
334
			//Esta excepci?n no debe darse ya que se hace un calculateAdjustedView antes de la llamada.
335
		}
316 336
		return null;
317 337
	}
318 338
	
......
325 345
	 * @param h Alto del ?rea
326 346
	 * @throws ArrayIndexOutOfBoundsException
327 347
	 */
328
	public void setAreaOfInterest(int x, int y, int w, int h) throws ArrayIndexOutOfBoundsException{
329
		if((x + w) > getWidth() || (y + h) > getHeight())
330
			throw new ArrayIndexOutOfBoundsException("Out of Image");
348
	public void setAreaOfInterest(int x, int y, int w, int h){
349
		x = (x < 0) ? 0 : x;
350
		y = (y < 0) ? 0 : y;
351
		w = (w > getWidth()) ? getWidth() : w;
352
		h = (w > getHeight()) ? getHeight() : h;
353
		
331 354
		dataExtent = new Extent(mDataset.rasterToWorld(new Point2D.Double(x, y)), 
332 355
								mDataset.rasterToWorld(new Point2D.Double(x + w, y + h)));
333
		rasterBuf = mDataset.getWindowRaster(x, y, w, h);
356
		try {
357
			rasterBuf = mDataset.getWindowRaster(x, y, w, h);
358
		} catch (InvalidSetViewException e) {
359
			//Esta excepci?n no debe darse ya que se hace un calculateAdjustedView antes de la llamada.
360
		}
334 361
	}
335 362
	
336 363
	/**
337 364
	 * Asigna el ?rea de inter?s a toda la extensi?n del raster.
338 365
	 */
339
	public void setAreaOfInterest() {		
366
	public void setAreaOfInterest() throws InvalidSetViewException {		
340 367
		dataExtent = mDataset.getExtent();
341 368
		rasterBuf = mDataset.getWindowRaster(0, 0, (int)mDataset.getWidth()[0], (int)mDataset.getHeight()[0]);
342 369
	}
......
353 380
	 * @param bufHeight Alto del buffer
354 381
	 * @throws ArrayIndexOutOfBoundsException
355 382
	 */
356
	public void setAreaOfInterest(int x, int y, int w, int h, int bufWidth, int bufHeight) throws ArrayIndexOutOfBoundsException{
383
	public void setAreaOfInterest(int x, int y, int w, int h, int bufWidth, int bufHeight) 
384
		throws InvalidSetViewException {
357 385
		//TODO: VALIDACI?N: Comprobaci?n de exceso de memoria reservada
358
		if(x < 0 || y < 0 || (x + w) > getWidth() || (y + h) > getHeight())
359
			throw new ArrayIndexOutOfBoundsException("Out of Image");
386
		x = (x < 0) ? 0 : x;
387
		y = (y < 0) ? 0 : y;
388
		w = (w > getWidth()) ? getWidth() : w;
389
		h = (w > getHeight()) ? getHeight() : h;
390
		
360 391
		dataExtent = new Extent(mDataset.rasterToWorld(new Point2D.Double(x, y)), 
361 392
								mDataset.rasterToWorld(new Point2D.Double(x + w, y + h)));
362 393

  
trunk/libraries/libRaster/src/org/gvsig/raster/buffer/cache/RasterReadOnlyHugeBuffer.java
1 1
package org.gvsig.raster.buffer.cache;
2 2

  
3
import java.awt.geom.Point2D;
3 4
import java.io.File;
4 5
import java.io.FileNotFoundException;
5 6

  
......
8 9
import org.gvsig.raster.buffer.RasterBuffer;
9 10
import org.gvsig.raster.buffer.RasterMemoryBuffer;
10 11
import org.gvsig.raster.dataset.Band;
11
import org.gvsig.raster.dataset.BandFoundInListException;
12 12
import org.gvsig.raster.dataset.BandList;
13
import org.gvsig.raster.dataset.BandNotFoundInListException;
14
import org.gvsig.raster.dataset.FileNotExistsException;
13 15
import org.gvsig.raster.dataset.IBuffer;
16
import org.gvsig.raster.dataset.InvalidSetViewException;
14 17
import org.gvsig.raster.dataset.NotSupportedExtensionException;
15 18
import org.gvsig.raster.dataset.RasterDataset;
16 19
import org.gvsig.raster.dataset.RasterDriverException;
......
52 55
	 */
53 56
	private BandList bandList = null;
54 57
	private int[] drawableBands = null;
58
	/**
59
	 * Extensi?n asociada al buffer
60
	 */
61
	private int minX = 0, minY = 0, maxX = 0, maxY = 0;
55 62
	
56 63
	/**
57 64
	 * Para extraer el desplazamiento de una direcci?n (l?nea de raster) hay que hacer una operaci?n And con 
......
76 83
     * @throws NotSupportedExtensionException 
77 84
     * @throws FileNotFoundException 
78 85
     */
79
	public RasterReadOnlyHugeBuffer(int dataType, int width, int height, int nBand, String fileName) 
86
	public RasterReadOnlyHugeBuffer(int dataType, int width, int height, int nBand) 
80 87
		throws FileNotFoundException, NotSupportedExtensionException, RasterDriverException {
88
		
89
		this.dataType = dataType;
90
        this.width = width;
91
        this.height = height;
92
        this.nBands = nBand;	
93
	}
94
	
95
	/**
96
	 * Asigna los parametros relativos al buffer. Estos son el nombre del fichero asociado 
97
	 * y la extensi?n asignada
98
	 * @param fileName Nombre del fichero asociado
99
	 * @param ext Extensi?n
100
	 */
101
	public void setBufferParams(String fileName, Extent ext) 
102
		throws InvalidSetViewException, FileNotExistsException, NotSupportedExtensionException  {
103
		if(!new File(fileName).exists())
104
			throw new FileNotExistsException("File:" + fileName);
105
		
106
		try {
107
			dataset = RasterDataset.open(null, fileName);
108
		} catch (RasterDriverException e) {
109
			throw new FileNotExistsException("File:" + fileName);
110
		}
111
		
112
		if(	ext.minX() < dataset.getExtent().minX() || ext.minY() < dataset.getExtent().minY() ||
113
			ext.maxX() > dataset.getExtent().maxX() || ext.maxY() > dataset.getExtent().maxY())
114
			throw new InvalidSetViewException("");
115
		
116
		Point2D p1 = dataset.worldToRaster(new Point2D.Double(minX, maxY));
117
		Point2D p2 = dataset.worldToRaster(new Point2D.Double(maxX, minY));
118
		
81 119
		this.fileName = fileName;
120
		this.minX = (int)p1.getX();
121
		this.minY = (int)p1.getY();
122
		this.maxX = (int)p2.getX();
123
		this.maxY = (int)p2.getY();
82 124
		
83
		File file = new File(fileName);
84
		if(!file.exists())
85
			throw new FileNotFoundException("I can't make read only cache structure.");
86
				
87
		dataset = RasterDataset.open(null, fileName);
125
		init();
126
	}
127
			
128
	/**
129
	 * Asigna los parametros relativos al buffer. Estos son el nombre del fichero asociado 
130
	 * y la extensi?n asignada
131
	 * @param fileName Nombre del fichero asociado
132
	 * @param ext Extensi?n
133
	 */
134
	public void setBufferParams(String fileName, int minX, int minY, int maxX, int maxY) 
135
		throws InvalidSetViewException, FileNotExistsException, NotSupportedExtensionException {
136
		if(!new File(fileName).exists())
137
			throw new FileNotExistsException("File:" + fileName);
88 138
		
89
		page = new RasterMemoryBuffer(dataType, width, RasterLibrary.blockHeight, dataset.getBandCount(), true);
139
		try {
140
			dataset = RasterDataset.open(null, fileName);
141
		} catch (RasterDriverException e) {
142
			throw new FileNotExistsException("File:" + fileName);
143
		}
90 144
		
145
		this.fileName = fileName;
146
		this.minX = minX;
147
		this.minY = minY;
148
		this.maxX = maxX;
149
		this.maxY = maxY;
150
		
151
		init();
152
	}
153
	
154
	/**
155
	 * Acciones de inicializaci?n. 
156
	 * Crear el buffer de memoria y la lista de bandas, as? comno los bits empleados
157
	 * por cada p?gina de memoria y el desplazamiento que supone para el calculo
158
	 * de direcciones.
159
	 */
160
	private void init() {
91 161
		//Calculo de los bits por p?gina
92 162
		int h = RasterLibrary.blockHeight; 
93 163
		while(h > 1) {
94 164
			h >>= 1;
95 165
			bitsPag ++;
96 166
		}
97
		offset = RasterLibrary.blockHeight - 1;
98 167
		
168
		//Calculo del desplazamiento
169
		offset = RasterLibrary.blockHeight - 1;    
170
		
171
		page = new RasterMemoryBuffer(dataType, width, RasterLibrary.blockHeight, dataset.getBandCount(), true);
172
		
99 173
		nPages = (int)Math.ceil((double)dataset.getHeight() / (double)RasterLibrary.blockHeight);
100 174
		//extentList = calcExtentPages(dataset, nPages);
101 175
		double aux = ((double)dataset.getHeight() / (double)RasterLibrary.blockHeight);
......
106 180
			drawableBands[i] = i;
107 181

  
108 182
    	bandList = new BandList();
109
		for(int i = 0; i < dataset.getBandCount();i++){
183
		for(int i = 0; i < dataset.getBandCount();i++) {
110 184
			try{
111 185
				Band band = new Band(dataset.getFName(), i, dataset.getDataType());
112 186
				band.setPositionToDrawInBuffer(i);
113 187
				bandList.addBand(band, i);
114
			}catch(BandFoundInListException ex){
188
			}catch(BandNotFoundInListException ex) {
115 189
				//No a?adimos la banda
116 190
			}
117 191
		}
118
		
119
    	this.dataType = dataType;
120
        this.width = width;
121
        this.height = height;
122
        this.nBands = nBand;
123 192
	}
124
			
193
	
194
	
125 195
	/**
126 196
	 * Calcula la extensi?n de las p?ginas en coordenadas del mundo real
127 197
	 * @param dataset Dataset
trunk/libraries/libRaster/src/org/gvsig/raster/buffer/cache/CacheDataFromDriverServer.java
22 22
import java.io.IOException;
23 23

  
24 24
import org.gvsig.raster.dataset.Band;
25
import org.gvsig.raster.dataset.BandFoundInListException;
25
import org.gvsig.raster.dataset.BandNotFoundInListException;
26 26
import org.gvsig.raster.dataset.BandList;
27 27
import org.gvsig.raster.dataset.NotSupportedExtensionException;
28 28
import org.gvsig.raster.dataset.RasterDataset;
......
71 71
			try {
72 72
				Band band = new Band(dataset.getFName(), i, dataset.getDataType());
73 73
				bandList.addBand(band, i);
74
			} catch(BandFoundInListException ex) {
74
			} catch(BandNotFoundInListException ex) {
75 75
				//No a?adimos la banda
76 76
			}
77 77
		}
trunk/libraries/libRaster/src/org/gvsig/raster/buffer/cache/CacheDataServer.java
31 31

  
32 32
import org.gvsig.raster.RasterLibrary;
33 33
import org.gvsig.raster.dataset.Band;
34
import org.gvsig.raster.dataset.BandFoundInListException;
34
import org.gvsig.raster.dataset.BandNotFoundInListException;
35 35
import org.gvsig.raster.dataset.BandList;
36 36
import org.gvsig.raster.dataset.GeoRasterWriter;
37 37
import org.gvsig.raster.dataset.IBuffer;
......
186 186
				Band band = new Band(grf.getFName(), i, grf.getDataType());
187 187
				bandList.addBand(band, i);
188 188
				bandList.addDrawableBand(i, i);
189
			}catch(BandFoundInListException ex){
189
			}catch(BandNotFoundInListException ex){
190 190
				//No a?adimos la banda
191 191
			}
192 192
		}
trunk/libraries/libRaster/src/org/gvsig/raster/buffer/RasterBuffer.java
90 90
   * @param width Ancho
91 91
   * @param height Alto
92 92
   * @param bandNr Banda
93
   * @param malloc
94
   * @return
93
   * @param flag En caso de buffers de memoria este flag a true significa que se reserva la memoria
94
   * para el buffer de forma normal y si est? a false no se reserva por lo que la reserva deber? ser
95
   * posterior. 
96
   * @return Objeto RasterBuffer
95 97
   * @throws RasterDriverException 
96 98
   * @throws NotSupportedExtensionException 
97 99
   * @throws FileNotFoundException 
98 100
   */
99
  public static RasterBuffer getBuffer(int dataType, int width, int height, int bandNr, boolean malloc, String filePath) 
101
  public static RasterBuffer getBuffer(int dataType, int width, int height, int bandNr, boolean malloc) 
100 102
  	/*throws FileNotFoundException, NotSupportedExtensionException, RasterDriverException*/{
101 103
  	//Opci?n de cachear siempre activada (Solo DEBUG)
102 104
  	if(forceToLoadInCache)
103 105
  		return new RasterCache(dataType, width, height, bandNr);
104
  	if(forceToLoadInReadOnlyCache && filePath != null){
106
  	if(forceToLoadInReadOnlyCache){
105 107
		try {
106
			return new RasterReadOnlyHugeBuffer(dataType, width, height, bandNr, filePath);
108
			return new RasterReadOnlyHugeBuffer(dataType, width, height, bandNr);
107 109
		} catch (FileNotFoundException e) {
108 110
			//TODO: EXCEPTION: Modificar el lanzamiento de excepciones del RasterBuffer
109 111
			e.printStackTrace();
trunk/libraries/libRaster/src/org/gvsig/raster/dataset/BandFoundInListException.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19
package org.gvsig.raster.dataset;
20

  
21
/**
22
 * Excepci?n cuando una banda no se encuentra en una lista en la
23
 * que se est? buscando y dicha falta constituye una situaci?n de
24
 * error.
25
 * @author Nacho Brodin (nachobrodin@gmail.com)
26
 *
27
 */
28
public class BandFoundInListException extends Exception{
29
	final private static long serialVersionUID = 0;
30
	public BandFoundInListException(String msg){
31
		super(msg);
32
	}
33
}
trunk/libraries/libRaster/src/org/gvsig/raster/dataset/FileFoundInListException.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19
package org.gvsig.raster.dataset;
20

  
21
/**
22
 * Excepci?n cuando un fichero no se encuentra en una lista en la
23
 * que se est? buscando y dicha falta constituye una situaci?n de
24
 * error.
25
 * @author Nacho Brodin (nachobrodin@gmail.com)
26
 *
27
 */
28
public class FileFoundInListException extends Exception{
29
	public FileFoundInListException(String msg){
30
		super(msg);
31
	}
32
}
trunk/libraries/libRaster/src/org/gvsig/raster/dataset/FileNotFoundInListException.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19
package org.gvsig.raster.dataset;
20

  
21
/**
22
 * Excepci?n cuando un fichero no se encuentra en una lista en la
23
 * que se est? buscando y dicha falta constituye una situaci?n de
24
 * error.
25
 * @author Nacho Brodin (nachobrodin@gmail.com)
26
 *
27
 */
28
public class FileNotFoundInListException extends Exception{
29
	public FileNotFoundInListException(String msg){
30
		super(msg);
31
	}
32
}
0 33

  
trunk/libraries/libRaster/src/org/gvsig/raster/dataset/BandList.java
123 123
	 * A?ade una banda a la lista.
124 124
	 * @param b banda a a?adir.
125 125
	 */
126
	public void addBand(Band b, int pos)throws BandFoundInListException{
126
	public void addBand(Band b, int pos)throws BandNotFoundInListException{
127 127
		bands.add(b);
128 128
	}
129 129
	
trunk/libraries/libRaster/src/org/gvsig/raster/dataset/FileNotExistsException.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19
package org.gvsig.raster.dataset;
20

  
21
/**
22
 * Excepci?n producida cuando se intenta acceder a un fichero que no existe.
23
 * 
24
 * @author Nacho Brodin (nachobrodin@gmail.com)
25
 *
26
 */
27
public class FileNotExistsException extends Exception{
28
	public FileNotExistsException(String msg){
29
		super(msg);
30
	}
31
}
0 32

  
trunk/libraries/libRaster/src/org/gvsig/raster/dataset/RasterMultiDataset.java
24 24

  
25 25
import org.cresques.cts.IProjection;
26 26
import org.gvsig.raster.buffer.RasterBuffer;
27
import org.gvsig.raster.buffer.cache.RasterReadOnlyHugeBuffer;
27 28
import org.gvsig.raster.dataset.properties.DatasetColorInterpretation;
28 29
import org.gvsig.raster.dataset.properties.DatasetListHistogram;
29 30
import org.gvsig.raster.dataset.properties.DatasetListStatistics;
......
80 81
			for (int dataset = 0; dataset < param.length; dataset++)
81 82
				try {
82 83
					rmd.addDataset(RasterDataset.open(proj, param[dataset]));
83
				} catch (FileFoundInListException e) {
84
				} catch (FileNotFoundInListException e) {
84 85
					//No lo a?adimos en el dataset pq ya existe
85 86
				} 	
86 87
		} else if(datasetOpenParam instanceof IBuffer[]) {
......
88 89
			for (int dataset = 0; dataset < param.length; dataset++)
89 90
				try {
90 91
					rmd.addDataset(RasterDataset.open(proj, param[dataset]));
91
				} catch (FileFoundInListException e) {
92
				} catch (FileNotFoundInListException e) {
92 93
					//No lo a?adimos en el dataset pq ya existe
93 94
				} 	
94 95
		} else {
95 96
			RasterDataset rd = RasterDataset.open(proj, datasetOpenParam);
96 97
			try {
97 98
				rmd.addDataset(rd);
98
			} catch (FileFoundInListException e) {
99
			} catch (FileNotFoundInListException e) {
99 100
				//No lo a?adimos en el dataset pq ya existe
100 101
			}
101 102
		}
......
106 107
	 * Add a file to the list.
107 108
	 * @param f file to add.
108 109
	 */
109
	public void addDataset(RasterDataset f)throws FileFoundInListException {
110
	public void addDataset(RasterDataset f)throws FileNotFoundInListException {
110 111
		if(findDataset(f))
111
			throw new FileFoundInListException("The file already is in list.");
112
			throw new FileNotFoundInListException("The file already is in list.");
112 113
		files.add(f);
113 114
		addBands(f);
114 115
		stats = new DatasetListStatistics(files);
......
119 120
	 * @param f fichero a a?adir.
120 121
	 * @throws RasterDriverException 
121 122
	 */
122
	public void addDataset(String fileName)throws FileFoundInListException, NotSupportedExtensionException, RasterDriverException{
123
	public void addDataset(String fileName)throws FileNotFoundInListException, NotSupportedExtensionException, RasterDriverException{
123 124
		if(findDataset(fileName))
124
			throw new FileFoundInListException("The file already is in list.");
125
			throw new FileNotFoundInListException("The file already is in list.");
125 126
		RasterDataset f = RasterDataset.open(null, fileName);
126 127
		files.add(f);
127 128
		addBands(f);
......
141 142
			try {
142 143
				Band band = new Band(grf.getFName(), i, dataType);
143 144
				bandList.addBand(band, i);
144
			} catch(BandFoundInListException ex) {
145
			} catch(BandNotFoundInListException ex) {
145 146
				//No a?adimos la banda
146 147
			}
147 148
		}
......
260 261
	private IBuffer[] mallocBuffersDatasets(BandList bl, int width, int height){
261 262
		IBuffer[] buffers = new IBuffer[getDatasetCount()];
262 263
		for(int i = 0; i < getDatasetCount(); i++){
263
			buffers[i] =  RasterBuffer.getBuffer(getDataset(i).getDataType(), width, height, getDataset(i).getBandCount(), false, null);
264
			buffers[i] =  RasterBuffer.getBuffer(getDataset(i).getDataType(), width, height, getDataset(i).getBandCount(), false);
264 265
			
265 266
			//Asignamos las bandas de cada fichero que no se pintan a null y las que se pintan se reserva memoria
266 267
			String name = getDataset(i).getFName();
......
315 316
	 * @param bandList
316 317
	 * @return Buffer de datos
317 318
	 */
318
	public IBuffer getWindowRaster(double x, double y, double w, double h, boolean adjustToExtent) {
319
	public IBuffer getWindowRaster(double x, double y, double w, double h, boolean adjustToExtent) 
320
		throws InvalidSetViewException {
319 321
		
320 322
		Extent selectedExtent = new Extent(x, y, x + w, y - h);
321 323

  
......
333 335
		else
334 336
			bandList.getDrawableBandsCount();
335 337
		
336
		IBuffer raster = RasterBuffer.getBuffer(getDataType()[0], width, height, mallocNBands, false, null);
338
		IBuffer raster = RasterBuffer.getBuffer(getDataType()[0], width, height, mallocNBands, false);
337 339
		
338 340
		//Caso en el que un buffer no se puedan conmutar las bandas (t?picamente RasterReadOnlyHugeBuffer)
339
		if(!raster.isBandSwitchable())
340
			return RasterBuffer.getBuffer(getDataType()[0], width, height, getDataset(0).getBandCount(), false, getDataset(0).getFName());
341
		if(!raster.isBandSwitchable()) {
342
			RasterBuffer rb = RasterBuffer.getBuffer(getDataType()[0], width, height, getDataset(0).getBandCount(), false);
343
			if(rb instanceof RasterReadOnlyHugeBuffer) {
344
				try {
345
					((RasterReadOnlyHugeBuffer)rb).setBufferParams(getDataset(0).getFName(), selectedExtent);
346
				} catch (FileNotExistsException e) {
347
					//Esto no debe darse ya que se comprueba al hacer el open
348
				} catch (NotSupportedExtensionException e) {
349
					//Esto no debe darse ya que se comprueba al hacer el open
350
				}
351
				return rb;
352
			}
353
				
354
		}
341 355
					
342 356
		for(int iBand = 0; iBand < raster.getBandCount(); iBand ++)
343 357
			raster.assignBandToNotValid(iBand);
......
373 387
	 * @return Buffer de datos
374 388
	 */
375 389
	public IBuffer getWindowRaster(double minX, double minY, double maxX, double maxY, 
376
									int bufWidth, int bufHeight, boolean adjustToExtent) {
390
									int bufWidth, int bufHeight, boolean adjustToExtent) throws InvalidSetViewException {
391
		
392
		if(	minX < ((RasterDataset)files.get(0)).getExtent().minX() || minY < ((RasterDataset)files.get(0)).getExtent().minY() ||
393
			maxX > ((RasterDataset)files.get(0)).getExtent().maxX() || maxY > ((RasterDataset)files.get(0)).getExtent().maxY())
394
				throw new InvalidSetViewException("");
395
		
377 396
		int mallocNBands = 0;
378 397
		if(bandList.getDrawableArray() != null)
379 398
			mallocNBands = bandList.getDrawableArray().length;
380 399
		else
381 400
			bandList.getDrawableBandsCount();
382 401
		
383
		IBuffer raster = RasterBuffer.getBuffer(getDataType()[0], bufWidth, bufHeight, mallocNBands, false, null);
402
		IBuffer raster = RasterBuffer.getBuffer(getDataType()[0], bufWidth, bufHeight, mallocNBands, false);
384 403
		
385
		//Caso en el que un buffer no se puedan conmutar las bandas (t?picamente RasterReadOnlyHugeBuffer)
386
		if(!raster.isBandSwitchable())
387
			return RasterBuffer.getBuffer(getDataType()[0], bufWidth, bufHeight, getDataset(0).getBandCount(), false, getDataset(0).getFName());
404
		//TODO: FUNCIONALIDAD: Si la petici?n es muy grande en solo lectura y con resampleo de buffer
405
		//Este caso no deberia darse en una petici?n con resampleo ya que RasterReadOnlyHugeBuffer hace referencia a la imagen en disco
406
		/*if(!raster.isBandSwitchable()) {
407
			RasterBuffer rb = RasterBuffer.getBuffer(getDataType()[0], bufWidth, bufHeight, getDataset(0).getBandCount(), false);
408
			if(rb instanceof RasterReadOnlyHugeBuffer) {
409
				try {
410
					((RasterReadOnlyHugeBuffer)rb).setBufferParams(getDataset(0).getFName(), selectedExtent);
411
				} catch (FileNotExistsException e) {
412
					//Esto no debe darse ya que se comprueba al hacer el open
413
				} catch (NotSupportedExtensionException e) {
414
					//Esto no debe darse ya que se comprueba al hacer el open
415
				}
416
				return rb;
417
			}
418
		}*/
388 419
			
389 420
		for(int iBand = 0; iBand < raster.getBandCount(); iBand ++)
390 421
			raster.assignBandToNotValid(iBand);
......
416 447
	 * @param bandList
417 448
	 * @return Buffer de datos
418 449
	 */
419
	public IBuffer getWindowRaster(int x, int y, int w, int h) {
420
		IBuffer raster = RasterBuffer.getBuffer(getDataType()[0], w, h, bandList.getDrawableBandsCount(), false, null);
450
	public IBuffer getWindowRaster(int x, int y, int w, int h) throws InvalidSetViewException {
451
		if(x < 0 || y < 0 || w > ((RasterDataset)files.get(0)).getWidth() || h > ((RasterDataset)files.get(0)).getHeight())
452
			throw new InvalidSetViewException("Out of image");
421 453
		
454
		IBuffer raster = RasterBuffer.getBuffer(getDataType()[0], w, h, bandList.getDrawableBandsCount(), false);
455
		
422 456
		//Caso en el que un buffer no se puedan conmutar las bandas (t?picamente RasterReadOnlyHugeBuffer)
423
		if(!raster.isBandSwitchable())
424
			return RasterBuffer.getBuffer(getDataType()[0], w, h, getDataset(0).getBandCount(), false, getDataset(0).getFName());
457
		if(!raster.isBandSwitchable()) {
458
			RasterBuffer rb = RasterBuffer.getBuffer(getDataType()[0], w, h, getDataset(0).getBandCount(), false);
459
			if(rb instanceof RasterReadOnlyHugeBuffer) {
460
				try {
461
					((RasterReadOnlyHugeBuffer)rb).setBufferParams(getDataset(0).getFName(), x, y, x + w, y + h);
462
				} catch (FileNotExistsException e) {
463
					//Esto no debe darse ya que se comprueba al hacer el open
464
				} catch (NotSupportedExtensionException e) {
465
					//Esto no debe darse ya que se comprueba al hacer el open
466
				}
467
				return rb;
468
			}
469
		}
425 470
				
426 471
		for(int iBand = 0; iBand < raster.getBandCount(); iBand ++)
427 472
			raster.assignBandToNotValid(iBand);
......
449 494
	 * @param bandList
450 495
	 * @return Buffer de datos
451 496
	 */
452
	public IBuffer getWindowRaster(int x, int y, int w, int h, int bufWidth, int bufHeight) {
453
		IBuffer raster = RasterBuffer.getBuffer(getDataType()[0], bufWidth, bufHeight, bandList.getDrawableBandsCount(), false, null);
497
	public IBuffer getWindowRaster(int x, int y, int w, int h, int bufWidth, int bufHeight)  
498
		throws InvalidSetViewException {
499
		if(x < 0 || y < 0 || w > ((RasterDataset)files.get(0)).getWidth() || h > ((RasterDataset)files.get(0)).getHeight())
500
			throw new InvalidSetViewException("Out of image");
501
		
502
		IBuffer raster = RasterBuffer.getBuffer(getDataType()[0], bufWidth, bufHeight, bandList.getDrawableBandsCount(), false);
454 503
		for(int iBand = 0; iBand < raster.getBandCount(); iBand ++)
455 504
			raster.assignBandToNotValid(iBand);
456 505
		
457 506
		//Reservamos memoria para los buffers por dataset
458 507
		IBuffer[] bufferDatasets = mallocBuffersDatasets(bandList, bufWidth, bufHeight);
459 508
		
460
		//Caso en el que un buffer no se puedan conmutar las bandas (t?picamente RasterReadOnlyHugeBuffer)
461
		if(!raster.isBandSwitchable())
462
			return RasterBuffer.getBuffer(getDataType()[0], bufWidth, bufHeight, getDataset(0).getBandCount(), false, getDataset(0).getFName());
509
		//TODO: FUNCIONALIDAD: Si la petici?n es muy grande en solo lectura y con resampleo de buffer
510
		//Este caso no deberia darse en una petici?n con resampleo ya que RasterReadOnlyHugeBuffer hace referencia a la imagen en disco
511
		/*if(!raster.isBandSwitchable()) {
512
			RasterBuffer rb = RasterBuffer.getBuffer(getDataType()[0], bufWidth, bufHeight, getDataset(0).getBandCount(), false);
513
			if(rb instanceof RasterReadOnlyHugeBuffer) {
514
				try {
515
					((RasterReadOnlyHugeBuffer)rb).setBufferParams(getDataset(0).getFName(), x, y, x + w, y + h);
516
				} catch (FileNotExistsException e) {
517
					//Esto no debe darse ya que se comprueba al hacer el open
518
				} catch (NotSupportedExtensionException e) {
519
					//Esto no debe darse ya que se comprueba al hacer el open
520
				}
521
				return rb;
522
			}
523
		}*/
463 524
				
464 525
		for(int i = 0; i < getDatasetCount(); i++)
465 526
			bufferDatasets[i] = ((RasterDataset)files.get(i)).getWindowRaster(x, y, w, h, bufWidth, bufHeight, bandList, bufferDatasets[i]);
trunk/libraries/libRaster/src/org/gvsig/raster/dataset/BandNotFoundInListException.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19
package org.gvsig.raster.dataset;
20

  
21
/**
22
 * Excepci?n cuando una banda no se encuentra en una lista en la
23
 * que se est? buscando y dicha falta constituye una situaci?n de
24
 * error.
25
 * @author Nacho Brodin (nachobrodin@gmail.com)
26
 *
27
 */
28
public class BandNotFoundInListException extends Exception{
29
	final private static long serialVersionUID = 0;
30
	public BandNotFoundInListException(String msg){
31
		super(msg);
32
	}
33
}
0 34

  
trunk/libraries/libRaster/src/org/gvsig/raster/grid/filter/enhancement/LinearEnhancementFilter.java
98 98
        }
99 99
        
100 100
        nbands = stats.getBandCount();
101
        rasterResult = RasterBuffer.getBuffer(IBuffer.TYPE_BYTE, raster.getWidth(), raster.getHeight(), raster.getBandCount(), true, null);
101
        rasterResult = RasterBuffer.getBuffer(IBuffer.TYPE_BYTE, raster.getWidth(), raster.getHeight(), raster.getBandCount(), true);
102 102
    }
103 103

  
104 104
    /**
trunk/libraries/libRaster/src/org/gvsig/raster/grid/GridWriter.java
49 49
		extent.setXRange(dMinX, dMinX + iNX * dCellSize);
50 50
		extent.setYRange(dMinY, dMinY + iNY * dCellSize);
51 51
	
52
		rasterBuf = RasterBuffer.getBuffer(dataType, iNX, iNY, bands.length, true, null);
52
		rasterBuf = RasterBuffer.getBuffer(dataType, iNX, iNY, bands.length, true);
53 53
	}
54 54
	
55 55
	public void assign(byte value)throws RasterBufferInvalidAccessException{
trunk/libraries/libRaster/src/org/gvsig/raster/grid/Grid.java
136 136
		this.layerExtent = layerExtent;
137 137
		this.dataType = dataType;
138 138
		
139
		rasterBuf = RasterBuffer.getBuffer(dataType, layerExtent.getNX(), layerExtent.getNY(), bands.length, true, null);
139
		rasterBuf = RasterBuffer.getBuffer(dataType, layerExtent.getNX(), layerExtent.getNY(), bands.length, true);
140 140
		
141 141
		if (windowExtent.fitsIn(layerExtent))
142 142
			reader = new GridNotInterpolated(rasterBuf, layerExtent, windowExtent, bands); 

Also available in: Unified diff