32 |
32 |
import org.gvsig.raster.dataset.InvalidSetViewException;
|
33 |
33 |
import org.gvsig.raster.dataset.NotSupportedExtensionException;
|
34 |
34 |
import org.gvsig.raster.dataset.Params;
|
|
35 |
import org.gvsig.raster.dataset.Params.Param;
|
35 |
36 |
import org.gvsig.raster.dataset.io.RasterDriverException;
|
36 |
37 |
import org.gvsig.remoteClient.utils.Utilities;
|
37 |
38 |
import org.gvsig.remoteClient.wcs.WCSStatus;
|
... | ... | |
41 |
42 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException;
|
42 |
43 |
import com.iver.ai2.gvsig3d.map3d.layers.Layer3DProps;
|
43 |
44 |
import com.iver.cit.gvsig.exceptions.expansionfile.ExpansionFileReadException;
|
|
45 |
import com.iver.cit.gvsig.exceptions.layers.LoadLayerException;
|
44 |
46 |
import com.iver.cit.gvsig.fmap.ViewPort;
|
45 |
47 |
import com.iver.cit.gvsig.fmap.drivers.wcs.FMapWCSDriver;
|
46 |
48 |
import com.iver.cit.gvsig.fmap.drivers.wcs.FMapWCSDriverFactory;
|
... | ... | |
293 |
295 |
_downloadMonitor.monitorThis(cancelDownload, System.currentTimeMillis());
|
294 |
296 |
File f = _wmsDriver.getMap(_wmsStatus, cancelDownload);
|
295 |
297 |
_downloadMonitor.endMonitor();
|
|
298 |
|
296 |
299 |
if (f == null)
|
297 |
300 |
return;
|
298 |
301 |
synchronized (cacheMutex) {
|
299 |
302 |
FileUtils.copy(f, new File(fName));
|
|
303 |
|
300 |
304 |
}
|
301 |
305 |
|
302 |
306 |
} catch (Exception e) {
|
... | ... | |
480 |
484 |
|
481 |
485 |
FLyrRasterSE rasterLayer = (FLyrRasterSE) _layer;
|
482 |
486 |
BufferFactory bufferFactory = rasterLayer.getBufferFactory();
|
|
487 |
try {
|
|
488 |
if (bufferFactory == null) {
|
|
489 |
rasterLayer.init();
|
|
490 |
bufferFactory = rasterLayer.getBufferFactory();
|
|
491 |
}
|
|
492 |
} catch (LoadLayerException e1) {
|
|
493 |
// TODO Auto-generated catch block
|
|
494 |
e1.printStackTrace();
|
|
495 |
}
|
|
496 |
|
483 |
497 |
|
484 |
498 |
//int bands[] = { 0 };
|
485 |
499 |
bufferFactory.setAllDrawableBands();
|
... | ... | |
510 |
524 |
raster.setNoDataValue(0.0);
|
511 |
525 |
raster.setNotValidValue(0.0);
|
512 |
526 |
try {
|
513 |
|
WriterBufferServer bufferServer = new WriterBufferServer(
|
514 |
|
raster);
|
515 |
|
Params p = GeoRasterWriter.getWriter(fName).getParams();
|
516 |
|
AffineTransform at = new AffineTransform(tileExtent
|
517 |
|
.getWidth() / 32, 0, 0,
|
518 |
|
-(tileExtent.getHeight() / 32), tileExtent
|
519 |
|
.getMinX(), tileExtent.getMaxY());
|
520 |
|
GeoRasterWriter grw = GeoRasterWriter.getWriter(
|
521 |
|
bufferServer, fName, 1, at, raster.getWidth(),
|
522 |
|
raster.getHeight(), raster.getDataType(), p, null);
|
523 |
527 |
synchronized (cacheMutex) {
|
524 |
528 |
try {
|
|
529 |
WriterBufferServer bufferServer = new WriterBufferServer(
|
|
530 |
raster);
|
|
531 |
Params p = GeoRasterWriter.getWriter(fName).getParams();
|
|
532 |
// if (raster.getBandCount() == 1) {
|
|
533 |
// Param phot = (Param) p.getParamById("photometric");
|
|
534 |
// if (phot != null)
|
|
535 |
// phot.defaultValue = new Integer(1);
|
|
536 |
// }
|
|
537 |
AffineTransform at = new AffineTransform(tileExtent
|
|
538 |
.getWidth() / 32, 0, 0,
|
|
539 |
-(tileExtent.getHeight() / 32), tileExtent
|
|
540 |
.getMinX(), tileExtent.getMaxY());
|
|
541 |
|
|
542 |
GeoRasterWriter grw = GeoRasterWriter.getWriter(
|
|
543 |
bufferServer, fName, 1, at, raster.getWidth(),
|
|
544 |
raster.getHeight(), raster.getDataType(), p, null);
|
|
545 |
|
525 |
546 |
grw.dataWrite();
|
|
547 |
grw.writeClose();
|
526 |
548 |
} catch (InterruptedException e) {
|
527 |
549 |
e.printStackTrace();
|
528 |
550 |
}
|
529 |
|
grw.writeClose();
|
|
551 |
|
530 |
552 |
}
|
531 |
553 |
|
532 |
554 |
} catch (NotSupportedExtensionException e) {
|
533 |
|
// e.printStackTrace();
|
|
555 |
e.printStackTrace();
|
534 |
556 |
return;
|
535 |
557 |
} catch (RasterDriverException e) {
|
536 |
|
// e.printStackTrace();
|
|
558 |
e.printStackTrace();
|
537 |
559 |
return;
|
538 |
560 |
} catch (IOException e) {
|
539 |
|
// e.printStackTrace();
|
|
561 |
e.printStackTrace();
|
540 |
562 |
return;
|
541 |
563 |
}
|
542 |
564 |
|