Revision 210 org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultMultiRasterStore.java
DefaultMultiRasterStore.java | ||
---|---|---|
23 | 23 |
|
24 | 24 |
import java.awt.geom.AffineTransform; |
25 | 25 |
import java.awt.geom.Point2D; |
26 |
import java.awt.geom.Rectangle2D; |
|
26 | 27 |
import java.io.File; |
27 | 28 |
import java.util.ArrayList; |
28 | 29 |
|
... | ... | |
45 | 46 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
46 | 47 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
47 | 48 |
import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException; |
49 |
import org.gvsig.fmap.dal.coverage.grid.render.TileListener; |
|
48 | 50 |
import org.gvsig.fmap.dal.coverage.store.MultiRasterStore; |
49 | 51 |
import org.gvsig.fmap.dal.coverage.store.RasterDataStore; |
50 | 52 |
import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation; |
... | ... | |
60 | 62 |
import org.gvsig.raster.impl.buffer.cache.RasterReadOnlyBuffer; |
61 | 63 |
import org.gvsig.raster.impl.datastruct.BandListImpl; |
62 | 64 |
import org.gvsig.raster.impl.datastruct.DatasetBandImpl; |
65 |
import org.gvsig.raster.impl.datastruct.ExtentImpl; |
|
63 | 66 |
import org.gvsig.raster.impl.provider.DefaultRasterProvider; |
64 | 67 |
import org.gvsig.raster.impl.provider.RasterProvider; |
65 | 68 |
import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation; |
... | ... | |
581 | 584 |
|
582 | 585 |
return raster; |
583 | 586 |
} |
587 |
|
|
588 |
/* |
|
589 |
* (non-Javadoc) |
|
590 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getWindowRaster(double, double, double, double, int, int, org.gvsig.fmap.dal.coverage.grid.render.TileListener, int) |
|
591 |
*/ |
|
592 |
public void getWindowRaster(double ulx, double uly, double lrx, double lry, int bufWidth, int bufHeight, TileListener listener, int frameInPx) |
|
593 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
|
594 |
double[] step = null; |
|
595 |
Buffer buf = null; |
|
596 |
|
|
597 |
//Esta secci?n es para que no supersamplee el driver y pueda hacerse en el cliente |
|
598 |
if(!currentQuery.isSupersamplingLoadingBuffer()) { |
|
599 |
//nWidth = ((adjustedDataExtent.width() * mDataset.getDataset(0).getWidth()) / mDataset.getExtentForRequest().width()); |
|
600 |
//nHeight = ((adjustedDataExtent.height() * mDataset.getDataset(0).getHeight()) / mDataset.getExtentForRequest().height()); |
|
601 |
Point2D p1 = worldToRaster(new Point2D.Double(ulx, uly)); |
|
602 |
Point2D p2 = worldToRaster(new Point2D.Double(lrx, lry)); |
|
603 |
nWidth = Math.abs(p1.getX() - p2.getX()); |
|
604 |
nHeight = Math.abs(p1.getY() - p2.getY()); |
|
584 | 605 |
|
606 |
if(bufWidth > Math.ceil(nWidth) && bufHeight > Math.ceil(nHeight)) { |
|
607 |
step = calcSteps(ulx, uly, lrx, lry, nWidth, nHeight, bufWidth, bufHeight); |
|
608 |
buf = getWindowRaster(ulx, uly, lrx, lry); |
|
609 |
} |
|
610 |
} |
|
611 |
|
|
612 |
if(buf == null) |
|
613 |
buf = getWindowRaster(ulx, uly, lrx, lry, bufWidth, bufHeight, true); |
|
614 |
|
|
615 |
buf.setDataExtent(new Rectangle2D.Double(ulx, uly, Math.abs(ulx - lrx), Math.abs(uly - lry))); |
|
616 |
listener.nextBuffer(buf, new ExtentImpl(ulx, uly, lrx, lry), this.getAffineTransform(), step); |
|
617 |
listener.endReading(); |
|
618 |
} |
|
619 |
|
|
585 | 620 |
/* |
586 | 621 |
* (non-Javadoc) |
587 | 622 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getWindowRaster(double, double, double, double, int, int, boolean) |
Also available in: Unified diff