Revision 92
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.io/org.gvsig.raster.io.base/src/main/java/org/gvsig/fmap/dal/coverage/dataset/io/GdalNative.java | ||
---|---|---|
30 | 30 |
import org.gvsig.fmap.dal.coverage.dataset.Buffer; |
31 | 31 |
import org.gvsig.fmap.dal.coverage.datastruct.BandList; |
32 | 32 |
import org.gvsig.fmap.dal.coverage.datastruct.Extent; |
33 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
|
33 | 34 |
import org.gvsig.fmap.dal.coverage.process.RasterTask; |
34 | 35 |
import org.gvsig.fmap.dal.coverage.process.RasterTaskQueue; |
35 | 36 |
import org.gvsig.raster.impl.datastruct.ExtentImpl; |
... | ... | |
537 | 538 |
* @return Object que es un array unidimendional del tipo de datos del raster |
538 | 539 |
* @throws GdalException |
539 | 540 |
*/ |
540 |
public Object readBlock(int pos, int blockHeight) throws GdalException, InterruptedException { |
|
541 |
public Object readBlock(int pos, int blockHeight) throws GdalException, ProcessInterruptedException {
|
|
541 | 542 |
bBandNr = super.getRasterCount(); |
542 | 543 |
int nX = getRasterXSize(); |
543 | 544 |
|
... | ... | |
714 | 715 |
* @throws GdalException |
715 | 716 |
*/ |
716 | 717 |
public void readWindow(Buffer buf, BandList bandList, double ulx, double uly,double lrx, double lry, |
717 |
int nWidth, int nHeight, boolean adjustToExtent) throws GdalException, InterruptedException { |
|
718 |
int nWidth, int nHeight, boolean adjustToExtent) throws GdalException, ProcessInterruptedException {
|
|
718 | 719 |
Extent petExtent = new ExtentImpl(ulx, uly, lrx, lry); |
719 | 720 |
setView(ulx, uly, lrx, lry, nWidth, nHeight); |
720 | 721 |
Point2D tl = worldToRaster(new Point2D.Double(ulx, uly)); |
... | ... | |
780 | 781 |
* @throws GdalException |
781 | 782 |
*/ |
782 | 783 |
public void readWindow(Buffer buf, BandList bandList, double ulx, double uly, double lrx, double lry, |
783 |
double nWidth, double nHeight, int bufWidth, int bufHeight, boolean adjustToExtent) throws GdalException, InterruptedException { |
|
784 |
double nWidth, double nHeight, int bufWidth, int bufHeight, boolean adjustToExtent) throws GdalException, ProcessInterruptedException {
|
|
784 | 785 |
Extent petExtent = new ExtentImpl(ulx, uly, lrx, lry); |
785 | 786 |
setView(ulx, uly, lrx, lry, bufWidth, bufHeight); |
786 | 787 |
Point2D tl = worldToRaster(new Point2D.Double(ulx, uly)); |
... | ... | |
876 | 877 |
* @throws GdalException |
877 | 878 |
*/ |
878 | 879 |
public void readWindow(Buffer buf, BandList bandList, int x, int y, int w, int h) |
879 |
throws GdalException, InterruptedException { |
|
880 |
throws GdalException, ProcessInterruptedException {
|
|
880 | 881 |
gdalBands = new GdalRasterBand[getRasterCount()]; |
881 | 882 |
isSupersampling = false; |
882 | 883 |
if(gdalBands.length == 0) |
... | ... | |
907 | 908 |
* @param bufHeight Alto del buffer |
908 | 909 |
* @throws GdalException |
909 | 910 |
*/ |
910 |
public void readWindow(Buffer buf, BandList bandList, int x, int y, int w, int h, int bufWidth, int bufHeight) throws GdalException, InterruptedException { |
|
911 |
public void readWindow(Buffer buf, BandList bandList, int x, int y, int w, int h, int bufWidth, int bufHeight) throws GdalException, ProcessInterruptedException {
|
|
911 | 912 |
gdalBands = new GdalRasterBand[getRasterCount()]; |
912 | 913 |
|
913 | 914 |
if(gdalBands.length == 0) |
... | ... | |
967 | 968 |
* @throws GdalException |
968 | 969 |
*/ |
969 | 970 |
private void readData(Buffer buf, BandList bandList, int x, int y, int w, int h, |
970 |
int bufWidth, int bufHeight, int stpX, int stpY, int[] stepBuffer) throws GdalException, InterruptedException { |
|
971 |
int bufWidth, int bufHeight, int stpX, int stpY, int[] stepBuffer) throws GdalException, ProcessInterruptedException {
|
|
971 | 972 |
|
972 | 973 |
RasterTask task = RasterTaskQueue.get(Thread.currentThread().toString()); |
973 | 974 |
|
... | ... | |
1044 | 1045 |
* @param yMax altura m�xima de y |
1045 | 1046 |
* @throws GdalException |
1046 | 1047 |
*/ |
1047 |
private void readDataByLine(Buffer buf, BandList bandList, int x, int y, int w, int yMax) throws GdalException, InterruptedException { |
|
1048 |
private void readDataByLine(Buffer buf, BandList bandList, int x, int y, int w, int yMax) throws GdalException, ProcessInterruptedException {
|
|
1048 | 1049 |
GdalBuffer gdalBuf = null; |
1049 | 1050 |
int rasterBufLine; |
1050 | 1051 |
RasterTask task = RasterTaskQueue.get(Thread.currentThread().toString()); |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.io/org.gvsig.raster.io.base/src/main/java/org/gvsig/fmap/dal/coverage/dataset/io/PngWriter.java | ||
---|---|---|
28 | 28 |
import org.cresques.cts.IProjection; |
29 | 29 |
import org.gvsig.fmap.dal.coverage.dataset.io.features.PngFeatures; |
30 | 30 |
import org.gvsig.fmap.dal.coverage.datastruct.Params; |
31 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
|
31 | 32 |
import org.gvsig.fmap.dal.coverage.store.DataServerWriter; |
32 | 33 |
import org.gvsig.raster.impl.store.WriteFileFormatFeatures; |
33 | 34 |
import org.gvsig.raster.impl.store.writer.GeoRasterWriter; |
... | ... | |
137 | 138 |
* Realiza la funci?n de compresi?n a partir de un GeoRasterFile. |
138 | 139 |
* @throws IOException |
139 | 140 |
*/ |
140 |
public void fileWrite() throws IOException, InterruptedException { |
|
141 |
public void fileWrite() throws IOException, ProcessInterruptedException {
|
|
141 | 142 |
gdalWriter.fileWrite(); |
142 | 143 |
} |
143 | 144 |
|
... | ... | |
154 | 155 |
* Realiza la escritura de datos con los datos que le pasa el cliente. |
155 | 156 |
* @throws IOException |
156 | 157 |
*/ |
157 |
public void dataWrite() throws IOException, InterruptedException { |
|
158 |
public void dataWrite() throws IOException, ProcessInterruptedException {
|
|
158 | 159 |
if(colorInterp != null) |
159 | 160 |
gdalWriter.setColorBandsInterpretation(colorInterp.getValues()); |
160 | 161 |
gdalWriter.dataWrite(); |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.io/org.gvsig.raster.io.base/src/main/java/org/gvsig/fmap/dal/coverage/dataset/io/JpegWriter.java | ||
---|---|---|
28 | 28 |
import org.cresques.cts.IProjection; |
29 | 29 |
import org.gvsig.fmap.dal.coverage.dataset.io.features.JpegFeatures; |
30 | 30 |
import org.gvsig.fmap.dal.coverage.datastruct.Params; |
31 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
|
31 | 32 |
import org.gvsig.fmap.dal.coverage.store.DataServerWriter; |
32 | 33 |
import org.gvsig.raster.impl.store.WriteFileFormatFeatures; |
33 | 34 |
import org.gvsig.raster.impl.store.writer.GeoRasterWriter; |
... | ... | |
135 | 136 |
* Realiza la funci?n de compresi?n a partir de un GeoRasterFile. |
136 | 137 |
* @throws IOException |
137 | 138 |
*/ |
138 |
public void fileWrite() throws IOException, InterruptedException { |
|
139 |
public void fileWrite() throws IOException, ProcessInterruptedException {
|
|
139 | 140 |
gdalWriter.fileWrite(); |
140 | 141 |
} |
141 | 142 |
|
... | ... | |
151 | 152 |
* Realiza la escritura de datos con los datos que le pasa el cliente. |
152 | 153 |
* @throws IOException |
153 | 154 |
*/ |
154 |
public void dataWrite() throws IOException, InterruptedException { |
|
155 |
public void dataWrite() throws IOException, ProcessInterruptedException {
|
|
155 | 156 |
if (colorInterp != null) |
156 | 157 |
gdalWriter.setColorBandsInterpretation(colorInterp.getValues()); |
157 | 158 |
gdalWriter.dataWrite(); |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.io/org.gvsig.raster.io.base/src/main/java/org/gvsig/fmap/dal/coverage/dataset/io/GdalDriver.java | ||
---|---|---|
40 | 40 |
import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException; |
41 | 41 |
import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException; |
42 | 42 |
import org.gvsig.fmap.dal.coverage.exception.ParsingException; |
43 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
|
43 | 44 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
44 | 45 |
import org.gvsig.raster.impl.datastruct.ExtentImpl; |
45 | 46 |
import org.gvsig.raster.impl.datastruct.TransparencyImpl; |
... | ... | |
287 | 288 |
* @see org.gvsig.raster.dataset.RasterDataset#readBlock(int, int) |
288 | 289 |
*/ |
289 | 290 |
public Object readBlock(int pos, int blockHeight) |
290 |
throws InvalidSetViewException, FileNotOpenException, RasterDriverException, InterruptedException { |
|
291 |
throws InvalidSetViewException, FileNotOpenException, RasterDriverException, ProcessInterruptedException {
|
|
291 | 292 |
if(pos < 0) |
292 | 293 |
throw new InvalidSetViewException("Request out of grid"); |
293 | 294 |
|
... | ... | |
317 | 318 |
* (non-Javadoc) |
318 | 319 |
* @see org.gvsig.raster.dataset.RasterDataset#getWindowRaster(double, double, double, double, org.gvsig.raster.dataset.BandList, org.gvsig.raster.dataset.IBuffer) |
319 | 320 |
*/ |
320 |
public Buffer getWindowRaster(double ulx, double uly, double lrx, double lry, BandList bandList, Buffer rasterBuf) throws InterruptedException, RasterDriverException { |
|
321 |
public Buffer getWindowRaster(double ulx, double uly, double lrx, double lry, BandList bandList, Buffer rasterBuf) throws ProcessInterruptedException, RasterDriverException {
|
|
321 | 322 |
Extent selectedExtent = new ExtentImpl(ulx, uly, lrx, lry); |
322 | 323 |
setView(selectedExtent); |
323 | 324 |
|
... | ... | |
334 | 335 |
* (non-Javadoc) |
335 | 336 |
* @see org.gvsig.fmap.driver.GeoRasterFile#getWindowRaster(double, double, double, double, org.gvsig.fmap.driver.BandList, org.gvsig.fmap.driver.IBuffer) |
336 | 337 |
*/ |
337 |
public Buffer getWindowRaster(double ulx, double uly, double w, double h, BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws InterruptedException, RasterDriverException { |
|
338 |
public Buffer getWindowRaster(double ulx, double uly, double w, double h, BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws ProcessInterruptedException, RasterDriverException {
|
|
338 | 339 |
//El incremento o decremento de las X e Y depende de los signos de rotaci?n y escala en la matriz de transformaci?n. Por esto |
339 | 340 |
//tenemos que averiguar si lrx es x + w o x -w, asi como si lry es y + h o y - h |
340 | 341 |
Extent ext = getExtent(); |
... | ... | |
361 | 362 |
* (non-Javadoc) |
362 | 363 |
* @see org.gvsig.fmap.driver.GeoRasterFile#getWindowRaster(double, double, double, double, int, int, org.gvsig.fmap.driver.BandList, org.gvsig.fmap.driver.IBuffer) |
363 | 364 |
*/ |
364 |
public Buffer getWindowRaster(double minX, double minY, double maxX, double maxY, int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws InterruptedException, RasterDriverException { |
|
365 |
public Buffer getWindowRaster(double minX, double minY, double maxX, double maxY, int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws ProcessInterruptedException, RasterDriverException {
|
|
365 | 366 |
Extent selectedExtent = new ExtentImpl(minX, minY, maxX, maxY); |
366 | 367 |
setView(selectedExtent); |
367 | 368 |
|
... | ... | |
411 | 412 |
* (non-Javadoc) |
412 | 413 |
* @see org.gvsig.fmap.driver.GeoRasterFile#getWindowRaster(int, int, int, int, org.gvsig.fmap.driver.BandList, org.gvsig.fmap.driver.IBuffer) |
413 | 414 |
*/ |
414 |
public Buffer getWindowRaster(int x, int y, int w, int h, BandList bandList, Buffer rasterBuf) throws InterruptedException, RasterDriverException { |
|
415 |
public Buffer getWindowRaster(int x, int y, int w, int h, BandList bandList, Buffer rasterBuf) throws ProcessInterruptedException, RasterDriverException {
|
|
415 | 416 |
try { |
416 | 417 |
setView( |
417 | 418 |
new ExtentImpl( RasterUtilities.getMapRectFromPxRect(getExtent().toRectangle2D(), |
... | ... | |
430 | 431 |
* (non-Javadoc) |
431 | 432 |
* @see org.gvsig.fmap.driver.GeoRasterFile#getWindowRaster(int, int, int, int, int, int, org.gvsig.fmap.driver.BandList, org.gvsig.fmap.driver.IBuffer) |
432 | 433 |
*/ |
433 |
public Buffer getWindowRaster(int x, int y, int w, int h, int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf) throws InterruptedException, RasterDriverException { |
|
434 |
public Buffer getWindowRaster(int x, int y, int w, int h, int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf) throws ProcessInterruptedException, RasterDriverException {
|
|
434 | 435 |
try { |
435 | 436 |
setView( |
436 | 437 |
new ExtentImpl( RasterUtilities.getMapRectFromPxRect(getExtent().toRectangle2D(), |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.io/org.gvsig.raster.io.base/src/main/java/org/gvsig/fmap/dal/coverage/dataset/io/GdalWriter.java | ||
---|---|---|
37 | 37 |
import org.gvsig.fmap.dal.coverage.dataset.io.features.PNM_PpmFeatures; |
38 | 38 |
import org.gvsig.fmap.dal.coverage.datastruct.Params; |
39 | 39 |
import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException; |
40 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
|
40 | 41 |
import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException; |
41 | 42 |
import org.gvsig.fmap.dal.coverage.process.RasterTask; |
42 | 43 |
import org.gvsig.fmap.dal.coverage.process.RasterTaskQueue; |
... | ... | |
475 | 476 |
* @param posicionY Posici?ny a partir desde donde se comienza. |
476 | 477 |
*/ |
477 | 478 |
public void writeARGBBand(int sizeY, int posicionY) |
478 |
throws InterruptedException, OutOfMemoryError { |
|
479 |
throws ProcessInterruptedException, OutOfMemoryError {
|
|
479 | 480 |
int[] buftmp = dataWriter.readARGBData(sizeWindowX, sizeY, 0); |
480 | 481 |
for(int iBand = 0; iBand < nBands; iBand ++) |
481 | 482 |
bufBands[iBand].buffByte = new byte[buftmp.length]; |
... | ... | |
511 | 512 |
* @param posicionY Posici?n y a partir de la cual se escribe en el GDALRasterBand destino |
512 | 513 |
*/ |
513 | 514 |
private void writeBands(int sizeY, int posicionY) |
514 |
throws InterruptedException, OutOfMemoryError { |
|
515 |
throws ProcessInterruptedException, OutOfMemoryError {
|
|
515 | 516 |
//leemos el bloque origen |
516 | 517 |
|
517 | 518 |
switch(dataType){ |
... | ... | |
542 | 543 |
* @param mode Modo de escritura |
543 | 544 |
* @throws IOException |
544 | 545 |
*/ |
545 |
private void write(int mode) throws IOException, InterruptedException, |
|
546 |
private void write(int mode) throws IOException, ProcessInterruptedException,
|
|
546 | 547 |
OutOfMemoryError { |
547 | 548 |
RasterTask task = RasterTaskQueue.get(Thread.currentThread().toString()); |
548 | 549 |
|
... | ... | |
582 | 583 |
* Realiza la funci?n de compresi?n a partir de un GeoRasterFile. |
583 | 584 |
* @throws IOException |
584 | 585 |
*/ |
585 |
public void fileWrite() throws IOException, InterruptedException { |
|
586 |
public void fileWrite() throws IOException, ProcessInterruptedException {
|
|
586 | 587 |
write(GeoRasterWriter.MODE_FILEWRITE); |
587 | 588 |
} |
588 | 589 |
|
... | ... | |
615 | 616 |
* @throws IOException |
616 | 617 |
* @throws RmfSerializerException |
617 | 618 |
*/ |
618 |
public void dataWrite() throws IOException, InterruptedException, |
|
619 |
public void dataWrite() throws IOException, ProcessInterruptedException,
|
|
619 | 620 |
OutOfMemoryError { |
620 | 621 |
if (dataWriter == null) |
621 | 622 |
throw new IOException("No se ha obtenido un objeto de entrada para la escritura valido."); |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.io/org.gvsig.raster.io.base/src/main/java/org/gvsig/fmap/dal/coverage/dataset/io/MrSidNative.java | ||
---|---|---|
28 | 28 |
|
29 | 29 |
import org.gvsig.fmap.dal.coverage.dataset.Buffer; |
30 | 30 |
import org.gvsig.fmap.dal.coverage.datastruct.BandList; |
31 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
|
31 | 32 |
import org.gvsig.fmap.dal.coverage.process.RasterTask; |
32 | 33 |
import org.gvsig.fmap.dal.coverage.process.RasterTaskQueue; |
33 | 34 |
|
... | ... | |
385 | 386 |
* @param line Escena leida |
386 | 387 |
* @throws MrSIDException Lanzada si ocurre un error en la lectura de la escena |
387 | 388 |
*/ |
388 |
public void readScene(int[] line, RasterTask task) throws MrSIDException, InterruptedException { |
|
389 |
public void readScene(int[] line, RasterTask task) throws MrSIDException, ProcessInterruptedException {
|
|
389 | 390 |
//Posici�n de inicio de la escena en entero para la petici�n a la libreria |
390 | 391 |
int x = (int) Math.floor(currentViewX); |
391 | 392 |
int y = (int) Math.floor(currentViewY); |
... | ... | |
509 | 510 |
* @param h Alto en pixeles |
510 | 511 |
* @throws GdalException |
511 | 512 |
*/ |
512 |
public void readWindow(Buffer buf, BandList bandList, int x, int y, int w, int h) throws MrSIDException, InterruptedException { |
|
513 |
public void readWindow(Buffer buf, BandList bandList, int x, int y, int w, int h) throws MrSIDException, ProcessInterruptedException {
|
|
513 | 514 |
RasterTask task = RasterTaskQueue.get(Thread.currentThread().toString()); |
514 | 515 |
|
515 | 516 |
isSupersampling = false; |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.io/org.gvsig.raster.io.base/src/main/java/org/gvsig/fmap/dal/coverage/dataset/io/ErmapperDriver.java | ||
---|---|---|
37 | 37 |
import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException; |
38 | 38 |
import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException; |
39 | 39 |
import org.gvsig.fmap.dal.coverage.exception.ParsingException; |
40 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
|
40 | 41 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
41 | 42 |
import org.gvsig.fmap.dal.coverage.process.RasterTask; |
42 | 43 |
import org.gvsig.fmap.dal.coverage.process.RasterTaskQueue; |
... | ... | |
236 | 237 |
* (non-Javadoc) |
237 | 238 |
* @see org.gvsig.raster.dataset.RasterDataset#getWindowRaster(double, double, double, double, org.gvsig.raster.dataset.BandList, org.gvsig.raster.dataset.IBuffer) |
238 | 239 |
*/ |
239 |
public Buffer getWindowRaster(double ulx, double uly, double lrx, double lry, BandList bandList, Buffer rasterBuf) throws InterruptedException, RasterDriverException { |
|
240 |
public Buffer getWindowRaster(double ulx, double uly, double lrx, double lry, BandList bandList, Buffer rasterBuf) throws ProcessInterruptedException, RasterDriverException {
|
|
240 | 241 |
Point2D p1 = new Point2D.Double(ulx, uly); |
241 | 242 |
Point2D p2 = new Point2D.Double(lrx, lry); |
242 | 243 |
try { |
... | ... | |
264 | 265 |
* (non-Javadoc) |
265 | 266 |
* @see org.gvsig.fmap.driver.RasterDataset#getWindowRaster(double, double, double, double, org.gvsig.fmap.driver.BandList, org.gvsig.fmap.driver.Buffer, boolean) |
266 | 267 |
*/ |
267 |
public Buffer getWindowRaster(double ulx, double uly, double w, double h, BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws InterruptedException, RasterDriverException { |
|
268 |
public Buffer getWindowRaster(double ulx, double uly, double w, double h, BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws ProcessInterruptedException, RasterDriverException {
|
|
268 | 269 |
//El incremento o decremento de las X e Y depende de los signos de rotaci?n y escala en la matriz de transformaci?n. Por esto |
269 | 270 |
//tenemos que averiguar si lrx es x + w o x -w, asi como si lry es y + h o y - h |
270 | 271 |
Extent ext = getExtent(); |
... | ... | |
313 | 314 |
* (non-Javadoc) |
314 | 315 |
* @see org.gvsig.fmap.driver.RasterDataset#getWindowRaster(int, int, int, int, org.gvsig.fmap.driver.BandList, org.gvsig.fmap.driver.Buffer) |
315 | 316 |
*/ |
316 |
public Buffer getWindowRaster(int x, int y, int w, int h, BandList bandList, Buffer rasterBuf) throws InterruptedException, RasterDriverException { |
|
317 |
public Buffer getWindowRaster(int x, int y, int w, int h, BandList bandList, Buffer rasterBuf) throws ProcessInterruptedException, RasterDriverException {
|
|
317 | 318 |
Point2D init = this.rasterToWorld(new Point2D.Double(x, y)); |
318 | 319 |
Point2D end = this.rasterToWorld(new Point2D.Double(x + w, y + h)); |
319 | 320 |
Extent selectedExtent = new ExtentImpl(init.getX(), init.getY(), end.getX(), end.getY()); |
... | ... | |
328 | 329 |
* (non-Javadoc) |
329 | 330 |
* @see org.gvsig.fmap.driver.RasterDataset#getWindowRaster(double, double, double, double, int, int, org.gvsig.fmap.driver.BandList, org.gvsig.fmap.driver.Buffer, boolean) |
330 | 331 |
*/ |
331 |
public Buffer getWindowRaster(double ulx, double uly, double lrx, double lry, int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws InterruptedException, RasterDriverException { |
|
332 |
public Buffer getWindowRaster(double ulx, double uly, double lrx, double lry, int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws ProcessInterruptedException, RasterDriverException {
|
|
332 | 333 |
Point2D p1 = new Point2D.Double(ulx, uly); |
333 | 334 |
Point2D p2 = new Point2D.Double(lrx, lry); |
334 | 335 |
try { |
... | ... | |
353 | 354 |
* (non-Javadoc) |
354 | 355 |
* @see org.gvsig.fmap.driver.RasterDataset#getWindowRaster(int, int, int, int, int, int, org.gvsig.fmap.driver.BandList, org.gvsig.fmap.driver.Buffer) |
355 | 356 |
*/ |
356 |
public Buffer getWindowRaster(int x, int y, int w, int h, int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf) throws InterruptedException, RasterDriverException { |
|
357 |
public Buffer getWindowRaster(int x, int y, int w, int h, int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf) throws ProcessInterruptedException, RasterDriverException {
|
|
357 | 358 |
Point2D init = this.rasterToWorld(new Point2D.Double(x, y)); |
358 | 359 |
Point2D end = this.rasterToWorld(new Point2D.Double(x + w, y + h)); |
359 | 360 |
Extent selectedExtent = new ExtentImpl(init.getX(), init.getY(), end.getX(), end.getY()); |
... | ... | |
383 | 384 |
* @param bufHeight Alto de buffer |
384 | 385 |
* @param rasterBuf Buffer de datos |
385 | 386 |
*/ |
386 |
private void loadBuffer(Extent selectedExtent, int bufWidth, int bufHeight, Buffer rasterBuf, BandList bandList, int[] stpBuffer) throws InterruptedException, RasterDriverException { |
|
387 |
private void loadBuffer(Extent selectedExtent, int bufWidth, int bufHeight, Buffer rasterBuf, BandList bandList, int[] stpBuffer) throws ProcessInterruptedException, RasterDriverException {
|
|
387 | 388 |
try{ |
388 | 389 |
RasterTask task = RasterTaskQueue.get(Thread.currentThread().toString()); |
389 | 390 |
|
... | ... | |
442 | 443 |
} |
443 | 444 |
|
444 | 445 |
|
445 |
private void drawRGB(Buffer rasterBuf, int[] pRGBArray, int[] readBands, BandList bandList, RasterTask task) throws JNCSException, InterruptedException { |
|
446 |
private void drawRGB(Buffer rasterBuf, int[] pRGBArray, int[] readBands, BandList bandList, RasterTask task) throws JNCSException, ProcessInterruptedException {
|
|
446 | 447 |
int bandR = readBands[0]; |
447 | 448 |
int bandG = (readBands.length > 1) ? readBands[1] : -1; |
448 | 449 |
int bandB = (readBands.length > 2) ? readBands[2] : -1; |
... | ... | |
635 | 636 |
} |
636 | 637 |
|
637 | 638 |
/* |
638 |
* (non-Javadoc)
|
|
639 |
* @see org.gvsig.raster.dataset.RasterDataset#readBlock(int, int, int)
|
|
639 |
* (non-Javadoc) |
|
640 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#readBlock(int, int)
|
|
640 | 641 |
*/ |
641 |
public Object readBlock(int pos, int blockHeight) throws InvalidSetViewException, FileNotOpenException, RasterDriverException, InterruptedException { |
|
642 |
public Object readBlock(int pos, int blockHeight) throws InvalidSetViewException, FileNotOpenException, RasterDriverException, ProcessInterruptedException {
|
|
642 | 643 |
RasterTask task = RasterTaskQueue.get(Thread.currentThread().toString()); |
643 | 644 |
if(pos < 0) |
644 | 645 |
throw new InvalidSetViewException("Request out of grid"); |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.io/org.gvsig.raster.io.base/src/main/java/org/gvsig/fmap/dal/coverage/dataset/io/ErmapperWriter.java | ||
---|---|---|
30 | 30 |
import org.gvsig.fmap.dal.coverage.RasterLibrary; |
31 | 31 |
import org.gvsig.fmap.dal.coverage.dataset.Buffer; |
32 | 32 |
import org.gvsig.fmap.dal.coverage.datastruct.Params; |
33 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
|
33 | 34 |
import org.gvsig.fmap.dal.coverage.process.CancelEvent; |
34 | 35 |
import org.gvsig.fmap.dal.coverage.process.RasterTask; |
35 | 36 |
import org.gvsig.fmap.dal.coverage.process.RasterTaskQueue; |
... | ... | |
316 | 317 |
* Realiza la funci?n de compresi?n a partir de los datos pasados por el cliente. |
317 | 318 |
* @throws IOException |
318 | 319 |
*/ |
319 |
public void dataWrite() throws IOException, InterruptedException { |
|
320 |
public void dataWrite() throws IOException, ProcessInterruptedException {
|
|
320 | 321 |
if (dataWriter == null) |
321 | 322 |
throw new IOException("No se ha obtenido un objeto para la lectura valido."); |
322 | 323 |
|
... | ... | |
507 | 508 |
loadBufferFromImageDataType(dataBuffer); |
508 | 509 |
if (dataType == Buffer.TYPE_BYTE) |
509 | 510 |
loadBufferFromByteDataType(byteBuffer); |
510 |
//} catch (InterruptedException e) { |
|
511 |
//} catch (ProcessInterruptedException e) {
|
|
511 | 512 |
|
512 | 513 |
//} |
513 | 514 |
|
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.io/org.gvsig.raster.io.base/src/main/java/org/gvsig/fmap/dal/coverage/dataset/io/MrSidDriver.java | ||
---|---|---|
34 | 34 |
import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException; |
35 | 35 |
import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException; |
36 | 36 |
import org.gvsig.fmap.dal.coverage.exception.ParsingException; |
37 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
|
37 | 38 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
38 | 39 |
import org.gvsig.fmap.dal.coverage.process.RasterTask; |
39 | 40 |
import org.gvsig.fmap.dal.coverage.process.RasterTaskQueue; |
... | ... | |
199 | 200 |
|
200 | 201 |
public Buffer getWindowRaster(double ulx, double uly, double lrx, double lry, |
201 | 202 |
BandList bandList, Buffer rasterBuf) |
202 |
throws InterruptedException, RasterDriverException { |
|
203 |
throws ProcessInterruptedException, RasterDriverException {
|
|
203 | 204 |
RasterTask task = RasterTaskQueue.get(Thread.currentThread().toString()); |
204 | 205 |
|
205 | 206 |
// TODO: FUNCIONALIDAD: Hacer caso del bandList |
... | ... | |
240 | 241 |
* (non-Javadoc) |
241 | 242 |
* @see org.gvsig.raster.dataset.RasterDataset#getWindowRaster(double, double, double, double, org.gvsig.raster.dataset.BandList, org.gvsig.raster.dataset.Buffer, boolean) |
242 | 243 |
*/ |
243 |
public Buffer getWindowRaster(double ulx, double uly, double w, double h, BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws InterruptedException, RasterDriverException { |
|
244 |
public Buffer getWindowRaster(double ulx, double uly, double w, double h, BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws ProcessInterruptedException, RasterDriverException {
|
|
244 | 245 |
RasterTask task = RasterTaskQueue.get(Thread.currentThread().toString()); |
245 | 246 |
|
246 | 247 |
// El incremento o decremento de las X e Y depende de los signos de rotaci?n |
... | ... | |
293 | 294 |
* (non-Javadoc) |
294 | 295 |
* @see org.gvsig.raster.dataset.RasterDataset#getWindowRaster(double, double, double, double, int, int, org.gvsig.raster.dataset.BandList, org.gvsig.raster.dataset.Buffer, boolean) |
295 | 296 |
*/ |
296 |
public Buffer getWindowRaster(double ulx, double uly, double lrx, double lry, int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws InterruptedException, RasterDriverException { |
|
297 |
public Buffer getWindowRaster(double ulx, double uly, double lrx, double lry, int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws ProcessInterruptedException, RasterDriverException {
|
|
297 | 298 |
RasterTask task = RasterTaskQueue.get(Thread.currentThread().toString()); |
298 | 299 |
|
299 | 300 |
// Impedimos que los valores de ancho y alto de la im?gen sean menores que 1 |
... | ... | |
340 | 341 |
* (non-Javadoc) |
341 | 342 |
* @see org.gvsig.raster.dataset.RasterDataset#getWindowRaster(int, int, int, int, int, int, org.gvsig.raster.dataset.BandList, org.gvsig.raster.dataset.Buffer) |
342 | 343 |
*/ |
343 |
public Buffer getWindowRaster(int x, int y, int w, int h, int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf) throws InterruptedException, RasterDriverException { |
|
344 |
public Buffer getWindowRaster(int x, int y, int w, int h, int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf) throws ProcessInterruptedException, RasterDriverException {
|
|
344 | 345 |
RasterTask task = RasterTaskQueue.get(Thread.currentThread().toString()); |
345 | 346 |
|
346 | 347 |
// TODO: FUNCIONALIDAD: Hacer caso del bandList |
... | ... | |
378 | 379 |
* (non-Javadoc) |
379 | 380 |
* @see org.gvsig.raster.dataset.RasterDataset#readBlock(int, int) |
380 | 381 |
*/ |
381 |
public Object readBlock(int pos, int blockHeight) throws InvalidSetViewException, FileNotOpenException, RasterDriverException, InterruptedException { |
|
382 |
public Object readBlock(int pos, int blockHeight) throws InvalidSetViewException, FileNotOpenException, RasterDriverException, ProcessInterruptedException {
|
|
382 | 383 |
RasterTask task = RasterTaskQueue.get(Thread.currentThread().toString()); |
383 | 384 |
|
384 | 385 |
if (pos < 0) |
... | ... | |
433 | 434 |
return pRGBArray; |
434 | 435 |
} catch (MrSIDException e) { |
435 | 436 |
throw new RasterDriverException("Error reading data from MrSID library"); |
436 |
} catch (InterruptedException e) { |
|
437 |
} catch (ProcessInterruptedException e) {
|
|
437 | 438 |
// El proceso que debe ser interrumpido es el que llama a readLine. |
438 | 439 |
} |
439 | 440 |
return null; |
... | ... | |
443 | 444 |
* (non-Javadoc) |
444 | 445 |
* @see org.gvsig.raster.dataset.RasterDataset#getWindowRaster(int, int, int, int, org.gvsig.raster.dataset.BandList, org.gvsig.raster.dataset.Buffer) |
445 | 446 |
*/ |
446 |
public Buffer getWindowRaster(int x, int y, int w, int h, BandList bandList, Buffer rasterBuf) throws InterruptedException, RasterDriverException { |
|
447 |
public Buffer getWindowRaster(int x, int y, int w, int h, BandList bandList, Buffer rasterBuf) throws ProcessInterruptedException, RasterDriverException {
|
|
447 | 448 |
try { |
448 | 449 |
file.readWindow(rasterBuf, bandList, x, y, w, h); |
449 | 450 |
} catch (MrSIDException e) { |
Also available in: Unified diff