Revision 1046
org.gvsig.raster.postgis/trunk/org.gvsig.raster.postgis/org.gvsig.raster.postgis.io/src/main/java/org/gvsig/raster/postgis/io/PostGISRasterProvider.java | ||
---|---|---|
39 | 39 |
import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException; |
40 | 40 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
41 | 41 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
42 |
import org.gvsig.fmap.dal.coverage.store.RasterQuery; |
|
42 | 43 |
import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters; |
43 | 44 |
import org.gvsig.fmap.dal.exception.DataException; |
44 | 45 |
import org.gvsig.fmap.dal.exception.InitializeException; |
... | ... | |
328 | 329 |
|
329 | 330 |
/* |
330 | 331 |
* (non-Javadoc) |
332 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getDataSet(org.gvsig.fmap.dal.coverage.store.RasterQuery) |
|
333 |
*/ |
|
334 |
public Buffer getDataSet(RasterQuery q) { |
|
335 |
return null; |
|
336 |
} |
|
337 |
|
|
338 |
/* |
|
339 |
* (non-Javadoc) |
|
331 | 340 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(double, double, double, double, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.raster.cache.tile.provider.TileListener) |
332 | 341 |
*/ |
333 | 342 |
public void getWindow(Extent ex, int bufWidth, int bufHeight, |
org.gvsig.raster.lizardtech/trunk/org.gvsig.raster.lizardtech/org.gvsig.raster.lizardtech.io/src/main/java/org/gvsig/raster/lizardtech/io/LizardTechProvider.java | ||
---|---|---|
39 | 39 |
import org.gvsig.fmap.dal.coverage.exception.ParsingException; |
40 | 40 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
41 | 41 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
42 |
import org.gvsig.fmap.dal.coverage.store.RasterQuery; |
|
42 | 43 |
import org.gvsig.fmap.dal.spi.DataManagerProviderServices; |
43 | 44 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
44 | 45 |
import org.gvsig.metadata.MetadataLocator; |
... | ... | |
299 | 300 |
|
300 | 301 |
/* |
301 | 302 |
* (non-Javadoc) |
303 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getDataSet(org.gvsig.fmap.dal.coverage.store.RasterQuery) |
|
304 |
*/ |
|
305 |
public Buffer getDataSet(RasterQuery q) { |
|
306 |
return null; |
|
307 |
} |
|
308 |
|
|
309 |
/* |
|
310 |
* (non-Javadoc) |
|
302 | 311 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(double, double, double, double, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.raster.cache.tile.provider.TileListener) |
303 | 312 |
*/ |
304 | 313 |
public void getWindow(Extent ex, int bufWidth, int bufHeight, |
org.gvsig.raster.wmts/trunk/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSProvider.java | ||
---|---|---|
50 | 50 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
51 | 51 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
52 | 52 |
import org.gvsig.fmap.dal.coverage.exception.RemoteServiceException; |
53 |
import org.gvsig.fmap.dal.coverage.store.RasterQuery; |
|
53 | 54 |
import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation; |
54 | 55 |
import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer; |
55 | 56 |
import org.gvsig.fmap.dal.coverage.store.props.Transparency; |
... | ... | |
66 | 67 |
import org.gvsig.raster.cache.tile.provider.TileListener; |
67 | 68 |
import org.gvsig.raster.cache.tile.provider.TileServer; |
68 | 69 |
import org.gvsig.raster.impl.DefaultRasterManager; |
70 |
import org.gvsig.raster.impl.buffer.DefaultRasterQuery; |
|
69 | 71 |
import org.gvsig.raster.impl.datastruct.BandListImpl; |
70 | 72 |
import org.gvsig.raster.impl.datastruct.DatasetBandImpl; |
71 | 73 |
import org.gvsig.raster.impl.datastruct.ExtentImpl; |
... | ... | |
803 | 805 |
* (non-Javadoc) |
804 | 806 |
* @see org.gvsig.raster.impl.provider.TiledRasterProvider#getTile(int, int, int, org.gvsig.fmap.dal.coverage.datastruct.Extent) |
805 | 807 |
*/ |
806 |
public org.gvsig.raster.cache.tile.Tile getTile(int level, int tileCol, int tileRow, Extent ex, CacheStruct struct) throws TileGettingException {
|
|
807 |
//TODO: CODE NOT TESTED!!
|
|
808 |
public org.gvsig.raster.cache.tile.Tile getTile(DefaultRasterQuery q) throws TileGettingException {
|
|
809 |
//q.getResolutionLevel(), q.getTileCol(), q.getTileRow(), q.getBBox(), q.getCacheStruct()!
|
|
808 | 810 |
|
809 | 811 |
CacheStruct str = getTileServer().getStruct(); |
810 | 812 |
|
... | ... | |
813 | 815 |
WMTSTileMatrixSet tileMatrixSet = tileMatrixSetLink.getTileMatrixSet(); |
814 | 816 |
ArrayList<?> tileMatrixSetLimits = tileMatrixSetLink.getTileMatrixLimits(); |
815 | 817 |
|
816 |
WMTSTileMatrix tileMatrix = (WMTSTileMatrix)tileMatrixSet.getTileMatrix().get(level);
|
|
818 |
WMTSTileMatrix tileMatrix = (WMTSTileMatrix)tileMatrixSet.getTileMatrix().get(q.getResolutionLevel());
|
|
817 | 819 |
if(gridSubsets) { |
818 |
WMTSTileMatrixLimits tileMatrixLimits = (WMTSTileMatrixLimits)tileMatrixSetLimits.get(level);
|
|
820 |
WMTSTileMatrixLimits tileMatrixLimits = (WMTSTileMatrixLimits)tileMatrixSetLimits.get(q.getResolutionLevel());
|
|
819 | 821 |
tileMatrix = tileMatrixLimits.getTileMatrix(); |
820 | 822 |
} |
821 | 823 |
int bufWidth = tileMatrix.getTileWidth(); |
822 | 824 |
int bufHeight = tileMatrix.getTileHeight(); |
823 | 825 |
|
824 | 826 |
try { |
825 |
Rectangle2D r = ex.toRectangle2D();//new Rectangle2D.Double(Math.min(minX, maxX), Math.min(minY, maxY), Math.abs(maxX - minX), Math.abs(maxY - minY));
|
|
827 |
Rectangle2D r = q.getBBox().toRectangle2D();//new Rectangle2D.Double(Math.min(minX, maxX), Math.min(minY, maxY), Math.abs(maxX - minX), Math.abs(maxY - minY));
|
|
826 | 828 |
WMTSStatus status = buildWMTSStatus(r, bufWidth , bufHeight); |
827 | 829 |
|
828 |
int[] size = str.getTileSizeByLevel(level);
|
|
830 |
int[] size = str.getTileSizeByLevel(q.getResolutionLevel());
|
|
829 | 831 |
Tile tile = tileMatrix.new Tile(size[0], size[1], |
830 |
tileRow, tileCol,
|
|
831 |
ex.getULX(), ex.getULY(), ex.getLRX(), ex.getLRY());
|
|
832 |
q.getTileRow(), q.getTileCol(),
|
|
833 |
q.getBBox().getULX(), q.getBBox().getULY(), q.getBBox().getLRX(), q.getBBox().getLRY());
|
|
832 | 834 |
|
833 | 835 |
File file = getConnector().getTile(status, null); |
834 | 836 |
tile.file = file; |
... | ... | |
854 | 856 |
|
855 | 857 |
/* |
856 | 858 |
* (non-Javadoc) |
859 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getDataSet(org.gvsig.fmap.dal.coverage.store.RasterQuery) |
|
860 |
*/ |
|
861 |
public Buffer getDataSet(RasterQuery q) { |
|
862 |
return null; |
|
863 |
} |
|
864 |
|
|
865 |
/* |
|
866 |
* (non-Javadoc) |
|
857 | 867 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(double, double, double, double, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer, org.gvsig.fmap.dal.coverage.grid.render.TileListener, int) |
858 | 868 |
*/ |
859 | 869 |
public void getWindow(Extent ex, int bufWidth, int bufHeight, |
org.gvsig.raster.wcs/trunk/org.gvsig.raster.wcs/org.gvsig.raster.wcs.io/src/main/java/org/gvsig/raster/wcs/io/WCSProvider.java | ||
---|---|---|
46 | 46 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
47 | 47 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
48 | 48 |
import org.gvsig.fmap.dal.coverage.exception.RemoteServiceException; |
49 |
import org.gvsig.fmap.dal.coverage.store.RasterQuery; |
|
49 | 50 |
import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation; |
50 | 51 |
import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer; |
51 | 52 |
import org.gvsig.fmap.dal.coverage.store.props.Transparency; |
... | ... | |
630 | 631 |
} |
631 | 632 |
} |
632 | 633 |
|
634 |
/* |
|
635 |
* (non-Javadoc) |
|
636 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getDataSet(org.gvsig.fmap.dal.coverage.store.RasterQuery) |
|
637 |
*/ |
|
638 |
public Buffer getDataSet(RasterQuery q) { |
|
639 |
return null; |
|
640 |
} |
|
633 | 641 |
|
634 | 642 |
/* |
635 | 643 |
* (non-Javadoc) |
org.gvsig.raster.tools/trunk/org.gvsig.raster.tools/org.gvsig.raster.tools.multifile.io/src/main/java/org/gvsig/raster/tools/multifile/io/MultiFileProvider.java | ||
---|---|---|
46 | 46 |
import org.gvsig.fmap.dal.coverage.exception.ParsingException; |
47 | 47 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
48 | 48 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
49 |
import org.gvsig.fmap.dal.coverage.store.RasterQuery; |
|
49 | 50 |
import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters; |
50 | 51 |
import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation; |
51 | 52 |
import org.gvsig.fmap.dal.coverage.store.props.ColorTable; |
... | ... | |
621 | 622 |
RasterProvider prov = providerList.get(sub[0]); |
622 | 623 |
return prov.getData(x, y, sub[1]); |
623 | 624 |
} |
625 |
|
|
626 |
/* |
|
627 |
* (non-Javadoc) |
|
628 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getDataSet(org.gvsig.fmap.dal.coverage.store.RasterQuery) |
|
629 |
*/ |
|
630 |
public Buffer getDataSet(RasterQuery q) { |
|
631 |
return null; |
|
632 |
} |
|
624 | 633 |
|
625 | 634 |
/* |
626 | 635 |
* (non-Javadoc) |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/TiledRasterProvider.java | ||
---|---|---|
26 | 26 |
import org.gvsig.fmap.dal.coverage.datastruct.Extent; |
27 | 27 |
import org.gvsig.raster.cache.tile.Tile; |
28 | 28 |
import org.gvsig.raster.cache.tile.exception.TileGettingException; |
29 |
import org.gvsig.raster.cache.tile.provider.CacheStruct;
|
|
29 |
import org.gvsig.raster.impl.buffer.DefaultRasterQuery;
|
|
30 | 30 |
|
31 | 31 |
/** |
32 | 32 |
* Interface that should be implemented by tiled providers |
... | ... | |
81 | 81 |
* @return |
82 | 82 |
* @throws TileGettingException |
83 | 83 |
*/ |
84 |
public Tile getTile(int level, int tileCol, int tileRow, Extent ex, CacheStruct cacheStruct) throws TileGettingException;
|
|
84 |
public Tile getTile(DefaultRasterQuery q) throws TileGettingException;
|
|
85 | 85 |
|
86 | 86 |
/** |
87 |
* Gets a tile |
|
88 |
* @param level |
|
89 |
* Resolution level |
|
90 |
* @param tileCol |
|
91 |
* Tile column in the resolution level |
|
92 |
* @param tileRow |
|
93 |
* Tile row in the resolution level |
|
94 |
* @param bbox |
|
95 |
* Bounding box of the tile |
|
96 |
* @return |
|
97 |
* @throws TileGettingException |
|
98 |
*/ |
|
99 |
//public Tile getTile(int level, int tileCol, int tileRow, Extent ex, CacheStruct cacheStruct) throws TileGettingException; |
|
100 |
|
|
101 |
/** |
|
87 | 102 |
* Sets the tile cache data server. This is the server assigned by the client. |
88 | 103 |
* It will force to build a second level cache if the CacheStruct is not the same |
89 | 104 |
* as the owner. |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/DefaultRasterProvider.java | ||
---|---|---|
52 | 52 |
import org.gvsig.fmap.dal.coverage.exception.RemoteServiceException; |
53 | 53 |
import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException; |
54 | 54 |
import org.gvsig.fmap.dal.coverage.store.RasterDataStore; |
55 |
import org.gvsig.fmap.dal.coverage.store.RasterQuery; |
|
55 | 56 |
import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters; |
56 | 57 |
import org.gvsig.fmap.dal.coverage.store.parameter.RasterFileStoreParameters; |
57 | 58 |
import org.gvsig.fmap.dal.coverage.store.parameter.RemoteStoreParameters; |
... | ... | |
362 | 363 |
abstract public Object getData(int x, int y, int band)throws InvalidSetViewException, FileNotOpenException, RasterDriverException; |
363 | 364 |
|
364 | 365 |
/** |
366 |
* Gets the set of data selected in the {@link RasterQuery} |
|
367 |
* @param q |
|
368 |
* @return |
|
369 |
*/ |
|
370 |
abstract public Buffer getDataSet(RasterQuery q); |
|
371 |
|
|
372 |
/** |
|
365 | 373 |
* Gets a window of data from the source. The result of this operation could be a list of tiles |
366 | 374 |
* that are sent through the listener. |
367 | 375 |
* @param ex |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultRasterStore.java | ||
---|---|---|
81 | 81 |
import org.gvsig.raster.cache.tile.TileCacheLocator; |
82 | 82 |
import org.gvsig.raster.cache.tile.TileCacheManager; |
83 | 83 |
import org.gvsig.raster.cache.tile.exception.TileGettingException; |
84 |
import org.gvsig.raster.cache.tile.provider.CacheStruct; |
|
85 | 84 |
import org.gvsig.raster.cache.tile.provider.TileListener; |
86 | 85 |
import org.gvsig.raster.impl.DefaultRasterManager; |
86 |
import org.gvsig.raster.impl.buffer.DefaultRasterQuery; |
|
87 | 87 |
import org.gvsig.raster.impl.buffer.cache.RasterReadOnlyBuffer; |
88 | 88 |
import org.gvsig.raster.impl.datastruct.BandListImpl; |
89 | 89 |
import org.gvsig.raster.impl.datastruct.DatasetBandImpl; |
... | ... | |
241 | 241 |
public boolean isMosaic() { |
242 | 242 |
return provider.isMosaic(); |
243 | 243 |
} |
244 |
|
|
244 |
|
|
245 | 245 |
/* |
246 | 246 |
* (non-Javadoc) |
247 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getWindowRaster(double, double, double, double) |
|
247 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getWindowRaster(double, double, double, double, boolean)
|
|
248 | 248 |
*/ |
249 |
public Buffer getWindow(double ulx, double uly, double lrx, double lry)
|
|
249 |
public Buffer getWindowWithoutResampling(DefaultRasterQuery q)
|
|
250 | 250 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
251 |
|
|
252 |
//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 |
|
253 |
//tenemos que averiguar si lrx es x + w o x -w, asi como si lry es y + h o y - h |
|
254 |
Extent ext = getExtent(); |
|
255 |
Point2D pInit = provider.rasterToWorld(new Point2D.Double(0, 0)); |
|
256 |
Point2D pEnd = provider.rasterToWorld(new Point2D.Double((int)getWidth(), (int)getHeight())); |
|
257 |
double wRaster = Math.abs(pEnd.getX() - pInit.getX()); |
|
258 |
double hRaster = Math.abs(pEnd.getY() - pInit.getY()); |
|
259 |
double lrx = (((int)(ext.getULX() - wRaster)) == ((int)ext.getLRX())) ? (q.getX() - q.getW()) : (q.getX() + q.getW()); |
|
260 |
double lry = (((int)(ext.getULY() - hRaster)) == ((int)ext.getLRY())) ? (q.getY() - q.getH()) : (q.getY() + q.getH()); |
|
261 |
|
|
251 | 262 |
//Extent selectedExtent = new Extent(ulx, uly, lrx, lry); |
252 | 263 |
|
253 | 264 |
//Leemos pixels completos aunque el valor obtenido sea decimal. Esto se consigue redondeando |
254 | 265 |
//por arriba el m?s alto y por abajo el menor y luego restandolos |
255 | 266 |
|
256 |
Point2D p1 = provider.worldToRaster(new Point2D.Double(ulx, uly));
|
|
267 |
Point2D p1 = provider.worldToRaster(new Point2D.Double(q.getX(), q.getY()));
|
|
257 | 268 |
Point2D p2 = provider.worldToRaster(new Point2D.Double(lrx, lry)); |
269 |
int width = (int)Math.abs(Math.ceil(p2.getX()) - Math.floor(p1.getX())); |
|
270 |
int height = (int)Math.abs(Math.floor(p1.getY()) - Math.ceil(p2.getY())); |
|
258 | 271 |
|
259 |
//Para el valor mayor redondeamos por arriba. Para el valor menor redondeamos por abajo. |
|
260 |
double p1X = (p1.getX() > p2.getX()) ? Math.ceil(p1.getX()) : Math.floor(p1.getX()); |
|
261 |
double p1Y = (p1.getY() > p2.getY()) ? Math.ceil(p1.getY()) : Math.floor(p1.getY()); |
|
262 |
double p2X = (p2.getX() > p1.getX()) ? Math.ceil(p2.getX()) : Math.floor(p2.getX()); |
|
263 |
double p2Y = (p2.getY() > p1.getY()) ? Math.ceil(p2.getY()) : Math.floor(p2.getY()); |
|
264 |
|
|
265 |
int width = (int)Math.abs(p1X - p2X); |
|
266 |
int height = (int)Math.abs(p1Y - p2Y); |
|
267 |
|
|
268 | 272 |
//Ajustamos por si nos hemos salido del raster |
269 |
if(((int)(Math.min(p1X, p2X) + width)) > getWidth())
|
|
270 |
width = (int)(getWidth() - Math.min(p1X, p2X));
|
|
271 |
if(((int)(Math.min(p1Y, p2Y) + height)) > getHeight())
|
|
272 |
height = (int)(getHeight() - Math.min(p1Y, p2Y));
|
|
273 |
if(((int)(p1.getX() + width)) > getWidth())
|
|
274 |
width = (int)(getWidth() - p1.getX());
|
|
275 |
if(((int)(p1.getY() + height)) > getHeight())
|
|
276 |
height = (int)(getHeight() - p1.getY());
|
|
273 | 277 |
|
274 |
if (p1X < 0)
|
|
275 |
p1X = 0;
|
|
276 |
if (p1Y < 0)
|
|
277 |
p1Y = 0;
|
|
278 |
if (p2X > getWidth())
|
|
279 |
p2X = getWidth();
|
|
280 |
if (p2Y > getHeight())
|
|
281 |
p2Y = getHeight();
|
|
278 |
if (p1.getX() < 0)
|
|
279 |
p1.setLocation(0, p1.getY());
|
|
280 |
if (p1.getY() < 0)
|
|
281 |
p1.setLocation(p1.getX(), 0);
|
|
282 |
if (p2.getX() > getWidth())
|
|
283 |
p2.setLocation(getWidth(), p2.getY());
|
|
284 |
if (p2.getY() > getHeight())
|
|
285 |
p2.setLocation(p2.getX(), getHeight());
|
|
282 | 286 |
|
283 | 287 |
int mallocNBands = 0; |
284 | 288 |
if(bandList.getDrawableBands() != null) |
... | ... | |
303 | 307 |
return rb; |
304 | 308 |
} |
305 | 309 |
} |
310 |
|
|
311 |
//Si hemos redondeado los pixeles de la petici?n (p1 y p2) por arriba y por abajo deberemos calcular un extent mayor |
|
312 |
//equivalente a los pixeles redondeados. |
|
313 |
Point2D wc1 = provider.rasterToWorld(new Point2D.Double(Math.floor(p1.getX()), Math.floor(p1.getY()))); |
|
314 |
Point2D wc2 = provider.rasterToWorld(new Point2D.Double(Math.ceil(p2.getX()), Math.ceil(p2.getY()))); |
|
306 | 315 |
|
307 | 316 |
//Buffer RW |
308 | 317 |
Buffer raster = null; |
309 | 318 |
|
310 |
//Si hemos redondeado los pixeles de la petici?n (p1 y p2) por arriba y por abajo deberemos calcular un extent mayor |
|
311 |
//equivalente a los pixeles redondeados. |
|
312 |
Point2D wc1 = provider.rasterToWorld(new Point2D.Double(p1X, p1Y)); |
|
313 |
Point2D wc2 = provider.rasterToWorld(new Point2D.Double(p2X, p2Y)); |
|
314 |
|
|
315 | 319 |
if(forceToMemory) //Fuerza siempre buffer en memoria |
316 | 320 |
raster = DefaultRasterManager.getInstance().createMemoryBuffer(getDataType()[0], width, height, mallocNBands, true); |
317 | 321 |
else |
318 | 322 |
raster = DefaultRasterManager.getInstance().createBuffer(getDataType()[0], width, height, mallocNBands, true); |
323 |
|
|
324 |
if(!q.isAdjustToExtent()) |
|
325 |
initBufferToNoData(raster, bandList); |
|
319 | 326 |
|
320 |
Extent ex = rManager.getDataStructFactory().createExtent(wc1.getX(), wc1.getY(), wc2.getX(), wc2.getY());
|
|
321 |
raster = ((DefaultRasterProvider)provider).getWindow(ex, bandList, raster);
|
|
327 |
raster = ((DefaultRasterProvider)provider).getWindow(wc1.getX(), wc1.getY(),
|
|
328 |
Math.abs(wc2.getX() - wc1.getX()), Math.abs(wc2.getY() - wc1.getY()), bandList, raster, q.isAdjustToExtent());
|
|
322 | 329 |
|
323 | 330 |
return raster; |
324 | 331 |
} |
325 |
|
|
332 |
|
|
326 | 333 |
/* |
327 | 334 |
* (non-Javadoc) |
328 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getWindowRaster(double, double, double, double, boolean)
|
|
335 |
* @see org.gvsig.raster.impl.store.AbstractRasterDataStore#getWindowWithResampling(org.gvsig.raster.impl.buffer.DefaultRasterQuery)
|
|
329 | 336 |
*/ |
330 |
public Buffer getWindow(double ulx, double uly, double w, double h, boolean adjustToExtent)
|
|
337 |
public Buffer getWindowWithResampling(DefaultRasterQuery q)
|
|
331 | 338 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
332 |
//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 |
|
333 |
//tenemos que averiguar si lrx es x + w o x -w, asi como si lry es y + h o y - h |
|
334 |
Extent ext = getExtent(); |
|
335 |
Point2D pInit = provider.rasterToWorld(new Point2D.Double(0, 0)); |
|
336 |
Point2D pEnd = provider.rasterToWorld(new Point2D.Double((int)getWidth(), (int)getHeight())); |
|
337 |
double wRaster = Math.abs(pEnd.getX() - pInit.getX()); |
|
338 |
double hRaster = Math.abs(pEnd.getY() - pInit.getY()); |
|
339 |
double lrx = (((int)(ext.getULX() - wRaster)) == ((int)ext.getLRX())) ? (ulx - w) : (ulx + w); |
|
340 |
double lry = (((int)(ext.getULY() - hRaster)) == ((int)ext.getLRY())) ? (uly - h) : (uly + h); |
|
341 | 339 |
|
342 |
//Extent selectedExtent = new Extent(ulx, uly, lrx, lry); |
|
340 |
Point2D p1 = worldToRaster(new Point2D.Double(q.getBBox().getULX(), q.getBBox().getULY())); |
|
341 |
Point2D p2 = worldToRaster(new Point2D.Double(q.getBBox().getLRX(), q.getBBox().getLRY()));; |
|
342 |
|
|
343 |
if(p1.getX() > p2.getX()) |
|
344 |
p1.setLocation(p1.getX() - 1, p1.getY()); |
|
345 |
else |
|
346 |
p2.setLocation(p2.getX() - 1, p2.getY()); |
|
347 |
|
|
348 |
if(p1.getY() > p2.getY()) |
|
349 |
p1.setLocation(p1.getX(), p1.getY() - 1); |
|
350 |
else |
|
351 |
p2.setLocation(p2.getX(), p2.getY() - 1); |
|
352 |
|
|
353 |
if( ((int)p1.getX()) < 0 || ((int)p2.getX()) > getWidth() || |
|
354 |
((int)p2.getY()) > getHeight() || ((int)p2.getY()) < 0) |
|
355 |
throw new InvalidSetViewException(""); |
|
343 | 356 |
|
357 |
int mallocNBands = 0; |
|
358 |
if(bandList.getDrawableBands() != null) |
|
359 |
mallocNBands = bandList.getDrawableBands().length; |
|
360 |
else |
|
361 |
mallocNBands = bandList.getDrawableBandsCount(); |
|
362 |
|
|
363 |
//Buffer ReadOnly |
|
364 |
|
|
365 |
if(isReadOnly()) { |
|
366 |
Buffer rb = DefaultRasterManager.getInstance().createReadOnlyBuffer(getDataType()[0], q.getBufWidth(), q.getBufHeight(), getBandCount()); |
|
367 |
if(rb instanceof RasterReadOnlyBuffer) { |
|
368 |
try { |
|
369 |
((RasterReadOnlyBuffer)rb).setBufferParams(this, (int)p1.getX(), (int)p1.getY(), (int)p2.getX(), (int)p2.getY(), bandList); |
|
370 |
} catch (FileNotExistsException e) { |
|
371 |
//Esto no debe darse ya que se comprueba al hacer el open. |
|
372 |
return null; |
|
373 |
} catch (NotSupportedExtensionException e) { |
|
374 |
//Esto no debe darse ya que se comprueba al hacer el open |
|
375 |
return null; |
|
376 |
} |
|
377 |
return rb; |
|
378 |
} |
|
379 |
} |
|
380 |
|
|
381 |
double ulx = q.getBBox().getULX(); |
|
382 |
double uly = q.getBBox().getULY(); |
|
383 |
double lrx = q.getBBox().getLRX(); |
|
384 |
double lry = q.getBBox().getLRY(); |
|
385 |
|
|
386 |
//Buffer RW |
|
387 |
Buffer raster = null; |
|
388 |
|
|
389 |
if(forceToMemory) //Fuerza siempre buffer en memoria |
|
390 |
raster = DefaultRasterManager.getInstance().createMemoryBuffer(getDataType()[0], q.getBufWidth(), q.getBufHeight(), mallocNBands, true); |
|
391 |
else |
|
392 |
raster = DefaultRasterManager.getInstance().createBuffer(getDataType()[0], q.getBufWidth(), q.getBufHeight(), mallocNBands, true); |
|
393 |
|
|
394 |
Extent ex = rManager.getDataStructFactory().createExtent(ulx, uly, lrx, lry); |
|
395 |
|
|
396 |
raster = ((DefaultRasterProvider)provider).getWindow(ex, q.getBufWidth(), q.getBufHeight(), bandList, raster, q.isAdjustToExtent()); |
|
397 |
|
|
398 |
return raster; |
|
399 |
} |
|
400 |
|
|
401 |
/* |
|
402 |
* (non-Javadoc) |
|
403 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getWindowRaster(double, double, double, double) |
|
404 |
*/ |
|
405 |
public Buffer getWindowWC(DefaultRasterQuery q) |
|
406 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
|
407 |
|
|
408 |
if(q.getBufWidth() > 0 && q.getBufHeight() > 0) |
|
409 |
return getWindowWithResampling(q); |
|
410 |
|
|
344 | 411 |
//Leemos pixels completos aunque el valor obtenido sea decimal. Esto se consigue redondeando |
345 | 412 |
//por arriba el m?s alto y por abajo el menor y luego restandolos |
346 | 413 |
|
347 |
Point2D p1 = provider.worldToRaster(new Point2D.Double(ulx, uly)); |
|
348 |
Point2D p2 = provider.worldToRaster(new Point2D.Double(lrx, lry)); |
|
349 |
int width = (int)Math.abs(Math.ceil(p2.getX()) - Math.floor(p1.getX())); |
|
350 |
int height = (int)Math.abs(Math.floor(p1.getY()) - Math.ceil(p2.getY())); |
|
414 |
Point2D p1 = provider.worldToRaster(new Point2D.Double(q.getBBox().getULX(), q.getBBox().getULY())); |
|
415 |
Point2D p2 = provider.worldToRaster(new Point2D.Double(q.getBBox().getLRX(), q.getBBox().getLRY())); |
|
351 | 416 |
|
417 |
//Para el valor mayor redondeamos por arriba. Para el valor menor redondeamos por abajo. |
|
418 |
double p1X = (p1.getX() > p2.getX()) ? Math.ceil(p1.getX()) : Math.floor(p1.getX()); |
|
419 |
double p1Y = (p1.getY() > p2.getY()) ? Math.ceil(p1.getY()) : Math.floor(p1.getY()); |
|
420 |
double p2X = (p2.getX() > p1.getX()) ? Math.ceil(p2.getX()) : Math.floor(p2.getX()); |
|
421 |
double p2Y = (p2.getY() > p1.getY()) ? Math.ceil(p2.getY()) : Math.floor(p2.getY()); |
|
422 |
|
|
423 |
int width = (int)Math.abs(p1X - p2X); |
|
424 |
int height = (int)Math.abs(p1Y - p2Y); |
|
425 |
|
|
352 | 426 |
//Ajustamos por si nos hemos salido del raster |
353 |
if(((int)(p1.getX() + width)) > getWidth())
|
|
354 |
width = (int)(getWidth() - p1.getX());
|
|
355 |
if(((int)(p1.getY() + height)) > getHeight())
|
|
356 |
height = (int)(getHeight() - p1.getY());
|
|
427 |
if(((int)(Math.min(p1X, p2X) + width)) > getWidth())
|
|
428 |
width = (int)(getWidth() - Math.min(p1X, p2X));
|
|
429 |
if(((int)(Math.min(p1Y, p2Y) + height)) > getHeight())
|
|
430 |
height = (int)(getHeight() - Math.min(p1Y, p2Y));
|
|
357 | 431 |
|
358 |
if (p1.getX() < 0)
|
|
359 |
p1.setLocation(0, p1.getY());
|
|
360 |
if (p1.getY() < 0)
|
|
361 |
p1.setLocation(p1.getX(), 0);
|
|
362 |
if (p2.getX() > getWidth())
|
|
363 |
p2.setLocation(getWidth(), p2.getY());
|
|
364 |
if (p2.getY() > getHeight())
|
|
365 |
p2.setLocation(p2.getX(), getHeight());
|
|
432 |
if (p1X < 0)
|
|
433 |
p1X = 0;
|
|
434 |
if (p1Y < 0)
|
|
435 |
p1Y = 0;
|
|
436 |
if (p2X > getWidth())
|
|
437 |
p2X = getWidth();
|
|
438 |
if (p2Y > getHeight())
|
|
439 |
p2Y = getHeight();
|
|
366 | 440 |
|
367 | 441 |
int mallocNBands = 0; |
368 | 442 |
if(bandList.getDrawableBands() != null) |
... | ... | |
387 | 461 |
return rb; |
388 | 462 |
} |
389 | 463 |
} |
390 |
|
|
391 |
//Si hemos redondeado los pixeles de la petici?n (p1 y p2) por arriba y por abajo deberemos calcular un extent mayor |
|
392 |
//equivalente a los pixeles redondeados. |
|
393 |
Point2D wc1 = provider.rasterToWorld(new Point2D.Double(Math.floor(p1.getX()), Math.floor(p1.getY()))); |
|
394 |
Point2D wc2 = provider.rasterToWorld(new Point2D.Double(Math.ceil(p2.getX()), Math.ceil(p2.getY()))); |
|
395 | 464 |
|
396 | 465 |
//Buffer RW |
397 | 466 |
Buffer raster = null; |
398 | 467 |
|
468 |
//Si hemos redondeado los pixeles de la petici?n (p1 y p2) por arriba y por abajo deberemos calcular un extent mayor |
|
469 |
//equivalente a los pixeles redondeados. |
|
470 |
Point2D wc1 = provider.rasterToWorld(new Point2D.Double(p1X, p1Y)); |
|
471 |
Point2D wc2 = provider.rasterToWorld(new Point2D.Double(p2X, p2Y)); |
|
472 |
|
|
399 | 473 |
if(forceToMemory) //Fuerza siempre buffer en memoria |
400 | 474 |
raster = DefaultRasterManager.getInstance().createMemoryBuffer(getDataType()[0], width, height, mallocNBands, true); |
401 | 475 |
else |
402 | 476 |
raster = DefaultRasterManager.getInstance().createBuffer(getDataType()[0], width, height, mallocNBands, true); |
403 |
|
|
404 |
if(!adjustToExtent) |
|
405 |
initBufferToNoData(raster, bandList); |
|
406 | 477 |
|
407 |
raster = ((DefaultRasterProvider)provider).getWindow(wc1.getX(), wc1.getY(), Math.abs(wc2.getX() - wc1.getX()), Math.abs(wc2.getY() - wc1.getY()), bandList, raster, adjustToExtent); |
|
478 |
Extent ex = rManager.getDataStructFactory().createExtent(wc1.getX(), wc1.getY(), wc2.getX(), wc2.getY()); |
|
479 |
raster = ((DefaultRasterProvider)provider).getWindow(ex, bandList, raster); |
|
408 | 480 |
|
409 | 481 |
return raster; |
410 | 482 |
} |
411 |
|
|
483 |
|
|
412 | 484 |
/* |
413 | 485 |
* (non-Javadoc) |
414 | 486 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getWindowRaster(double, double, double, double, int, int, org.gvsig.fmap.dal.coverage.grid.render.TileListener, int) |
415 | 487 |
*/ |
416 |
public void getWindow(double ulx, double uly, double lrx, double lry, |
|
417 |
int bufWidth, int bufHeight, TileListener listener) |
|
488 |
public void getWindowTiled(DefaultRasterQuery q, TileListener listener) |
|
418 | 489 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
419 | 490 |
if(isTiled()) { |
420 |
Extent ex = new ExtentImpl(ulx, uly, lrx, lry); |
|
421 |
((DefaultRasterProvider)provider).getWindow(ex, bufWidth, bufHeight, bandList, listener);
|
|
491 |
Extent ex = q.getBBox();//new ExtentImpl(ulx, uly, lrx, lry);
|
|
492 |
((DefaultRasterProvider)provider).getWindow(ex, q.getBufWidth(), q.getBufHeight(), bandList, listener);
|
|
422 | 493 |
return; |
423 | 494 |
} |
424 | 495 |
|
425 | 496 |
double[] step = null; |
426 | 497 |
Buffer buf = null; |
427 | 498 |
|
499 |
double ulx = q.getBBox().getULX(); |
|
500 |
double uly = q.getBBox().getULY(); |
|
501 |
double lrx = q.getBBox().getLRX(); |
|
502 |
double lry = q.getBBox().getLRY(); |
|
503 |
|
|
428 | 504 |
//Esta secci?n es para que no supersamplee el driver y pueda hacerse en el cliente |
429 | 505 |
if(!currentQuery.isSupersamplingLoadingBuffer()) { |
430 | 506 |
//nWidth = ((adjustedDataExtent.width() * mDataset.getDataset(0).getWidth()) / mDataset.getExtentForRequest().width()); |
... | ... | |
434 | 510 |
nWidth = Math.abs(p1.getX() - p2.getX()); |
435 | 511 |
nHeight = Math.abs(p1.getY() - p2.getY()); |
436 | 512 |
|
437 |
if(bufWidth > Math.ceil(nWidth) && bufHeight > Math.ceil(nHeight)) {
|
|
438 |
step = calcSteps(ulx, uly, lrx, lry, nWidth, nHeight, bufWidth, bufHeight);
|
|
439 |
buf = getWindow(ulx, uly, lrx, lry);
|
|
513 |
if(q.getBufWidth() > Math.ceil(nWidth) && q.getBufHeight() > Math.ceil(nHeight)) {
|
|
514 |
step = calcSteps(ulx, uly, lrx, lry, nWidth, nHeight, q.getBufWidth(), q.getBufHeight());
|
|
515 |
buf = getWindowWC(q);
|
|
440 | 516 |
} |
441 | 517 |
} |
442 | 518 |
|
443 |
if(buf == null) |
|
444 |
buf = getWindow(ulx, uly, lrx, lry, bufWidth, bufHeight, true); |
|
519 |
if(buf == null) { |
|
520 |
q.setAdjustToExtent(true); |
|
521 |
buf = getWindowWithResampling(q); |
|
522 |
} |
|
445 | 523 |
|
446 | 524 |
buf.setDataExtent(new Rectangle2D.Double(ulx, uly, Math.abs(ulx - lrx), Math.abs(uly - lry))); |
447 | 525 |
|
... | ... | |
451 | 529 |
bandList.setDrawableBands(new int[]{currentQuery.getAlphaBandNumber(), -1, -1}); |
452 | 530 |
for(int i = 0; i < provider.getInternalProviderCount(); i++) |
453 | 531 |
((AbstractRasterDataParameters)((DefaultRasterProvider)provider.getInternalProvider(i)).getDataParameters()).setAlphaBand(currentQuery.getAlphaBandNumber()); |
454 |
alphaBand = getWindow(ulx, uly, lrx, lry, bufWidth, bufHeight, true); |
|
532 |
q.setAdjustToExtent(true); |
|
533 |
alphaBand = getWindowWithResampling(q); |
|
455 | 534 |
bandList.setDrawableBands(drawableBands); |
456 | 535 |
} |
457 | 536 |
|
... | ... | |
483 | 562 |
* (non-Javadoc) |
484 | 563 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getTile(int, int, int, org.gvsig.fmap.dal.coverage.datastruct.Extent) |
485 | 564 |
*/ |
486 |
public Tile getTile(int level, int col, int row, Extent bbox, CacheStruct cacheStruct) throws TileGettingException {
|
|
565 |
public Tile getTile(DefaultRasterQuery q) throws TileGettingException {
|
|
487 | 566 |
TiledRasterProvider tiledProv = ((TiledRasterProvider)provider); |
488 |
return tiledProv.getTile(level, col, row, bbox, cacheStruct);
|
|
567 |
return tiledProv.getTile(q);
|
|
489 | 568 |
} |
490 | 569 |
|
491 | 570 |
/* |
492 | 571 |
* (non-Javadoc) |
493 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getWindowRaster(double, double, double, double, int, int, boolean)
|
|
572 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getWindowRaster(int, int, int, int, int, int)
|
|
494 | 573 |
*/ |
495 |
public Buffer getWindow(double ulx, double uly, double lrx, double lry, int bufWidth, int bufHeight, boolean adjustToExtent)
|
|
574 |
public Buffer getWindowPx(DefaultRasterQuery q)
|
|
496 | 575 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
497 |
|
|
498 |
Point2D p1 = worldToRaster(new Point2D.Double(ulx, uly));
|
|
499 |
Point2D p2 = worldToRaster(new Point2D.Double(lrx, lry));
|
|
576 |
step = null; |
|
577 |
if(q.getPixelX() < 0 || q.getPixelY() < 0 || q.getPixelW() > getWidth() || q.getPixelH() > getHeight())
|
|
578 |
throw new InvalidSetViewException("Out of image");
|
|
500 | 579 |
|
501 |
if(p1.getX() > p2.getX()) |
|
502 |
p1.setLocation(p1.getX() - 1, p1.getY()); |
|
503 |
else |
|
504 |
p2.setLocation(p2.getX() - 1, p2.getY()); |
|
505 |
|
|
506 |
if(p1.getY() > p2.getY()) |
|
507 |
p1.setLocation(p1.getX(), p1.getY() - 1); |
|
508 |
else |
|
509 |
p2.setLocation(p2.getX(), p2.getY() - 1); |
|
510 |
|
|
511 |
if( ((int)p1.getX()) < 0 || ((int)p2.getX()) > getWidth() || |
|
512 |
((int)p2.getY()) > getHeight() || ((int)p2.getY()) < 0) |
|
513 |
throw new InvalidSetViewException(""); |
|
580 |
q.setPixelX((q.getPixelX() < 0) ? 0 : q.getPixelX()); |
|
581 |
q.setPixelY((q.getPixelY() < 0) ? 0 : q.getPixelY()); |
|
582 |
q.setPixelW((q.getPixelW() > getWidth()) ? (int)getWidth() : q.getPixelW()); |
|
583 |
q.setPixelH((q.getPixelH() > getHeight()) ? (int)getHeight() : q.getPixelH()); |
|
514 | 584 |
|
515 |
int mallocNBands = 0; |
|
516 |
if(bandList.getDrawableBands() != null) |
|
517 |
mallocNBands = bandList.getDrawableBands().length; |
|
518 |
else |
|
519 |
mallocNBands = bandList.getDrawableBandsCount(); |
|
520 |
|
|
521 |
//Buffer ReadOnly |
|
522 |
|
|
523 |
if(isReadOnly()) { |
|
524 |
Buffer rb = DefaultRasterManager.getInstance().createReadOnlyBuffer(getDataType()[0], bufWidth, bufHeight, getBandCount()); |
|
525 |
if(rb instanceof RasterReadOnlyBuffer) { |
|
526 |
try { |
|
527 |
((RasterReadOnlyBuffer)rb).setBufferParams(this, (int)p1.getX(), (int)p1.getY(), (int)p2.getX(), (int)p2.getY(), bandList); |
|
528 |
} catch (FileNotExistsException e) { |
|
529 |
//Esto no debe darse ya que se comprueba al hacer el open. |
|
530 |
return null; |
|
531 |
} catch (NotSupportedExtensionException e) { |
|
532 |
//Esto no debe darse ya que se comprueba al hacer el open |
|
533 |
return null; |
|
534 |
} |
|
535 |
return rb; |
|
536 |
} |
|
537 |
} |
|
538 |
|
|
539 |
//Buffer RW |
|
540 |
Buffer raster = null; |
|
585 |
dataExtent = new ExtentImpl(rasterToWorld(new Point2D.Double(q.getPixelX(), q.getPixelY())), |
|
586 |
rasterToWorld(new Point2D.Double(q.getPixelX() + q.getPixelW(), q.getPixelY() + q.getPixelH()))); |
|
541 | 587 |
|
542 |
if(forceToMemory) //Fuerza siempre buffer en memoria |
|
543 |
raster = DefaultRasterManager.getInstance().createMemoryBuffer(getDataType()[0], bufWidth, bufHeight, mallocNBands, true); |
|
544 |
else |
|
545 |
raster = DefaultRasterManager.getInstance().createBuffer(getDataType()[0], bufWidth, bufHeight, mallocNBands, true); |
|
546 |
|
|
547 |
Extent ex = rManager.getDataStructFactory().createExtent(ulx, uly, lrx, lry); |
|
548 |
|
|
549 |
raster = ((DefaultRasterProvider)provider).getWindow(ex, bufWidth, bufHeight, bandList, raster, adjustToExtent); |
|
550 |
|
|
551 |
return raster; |
|
552 |
} |
|
553 |
|
|
554 |
/* |
|
555 |
* (non-Javadoc) |
|
556 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getWindowRaster(int, int, int, int) |
|
557 |
*/ |
|
558 |
// public Buffer getWindow(int x, int y, int w, int h) |
|
559 |
// throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
|
560 |
// if(x < 0 || y < 0 || w > provider.getWidth() || h > provider.getHeight()) |
|
561 |
// throw new InvalidSetViewException("Out of image"); |
|
562 |
// |
|
563 |
// //Buffer ReadOnly |
|
564 |
// |
|
565 |
// if(isReadOnly()) { |
|
566 |
// Buffer rb = DefaultRasterManager.getInstance().createReadOnlyBuffer(getDataType()[0], w, h, getBandCount()); |
|
567 |
// if(rb instanceof RasterReadOnlyBuffer) { |
|
568 |
// try { |
|
569 |
// ((RasterReadOnlyBuffer)rb).setBufferParams(this, x, y, x + w, y + h, bandList); |
|
570 |
// } catch (FileNotExistsException e) { |
|
571 |
// //Esto no debe darse ya que se comprueba al hacer el open. |
|
572 |
// return null; |
|
573 |
// } catch (NotSupportedExtensionException e) { |
|
574 |
// //Esto no debe darse ya que se comprueba al hacer el open |
|
575 |
// return null; |
|
576 |
// } |
|
577 |
// return rb; |
|
578 |
// } |
|
579 |
// } |
|
580 |
// |
|
581 |
// //Buffer RW |
|
582 |
// Buffer raster = null; |
|
583 |
// |
|
584 |
// if(forceToMemory) //Fuerza siempre buffer en memoria |
|
585 |
// raster = DefaultRasterManager.getInstance().createMemoryBuffer(getDataType()[0], w, h, bandList.getDrawableBandsCount(), true); |
|
586 |
// else |
|
587 |
// raster = DefaultRasterManager.getInstance().createBuffer(getDataType()[0], w, h, bandList.getDrawableBandsCount(), true); |
|
588 |
// |
|
589 |
// ((DefaultRasterProvider)provider).getWindow(x, y, bandList, raster); |
|
590 |
// |
|
591 |
// return raster; |
|
592 |
// } |
|
593 |
|
|
594 |
/* |
|
595 |
* (non-Javadoc) |
|
596 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getWindowRaster(int, int, int, int, int, int) |
|
597 |
*/ |
|
598 |
public Buffer getWindow(int x, int y, int w, int h, int bufWidth, int bufHeight) |
|
599 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
|
600 |
if(bufWidth < 0 || bufHeight < 0) { |
|
601 |
bufWidth = w; |
|
602 |
bufHeight = h; |
|
588 |
if( q.getType() == DefaultRasterQuery.TYPE_PX || |
|
589 |
q.getType() == DefaultRasterQuery.TYPE_ENTIRE || |
|
590 |
q.getBufWidth() <= 0 || q.getBufHeight() <= 0) { |
|
591 |
q.setBufWidth(q.getPixelW()); |
|
592 |
q.setBufHeight(q.getPixelH()); |
|
603 | 593 |
} |
604 |
|
|
605 |
if(x < 0 || y < 0 || w > provider.getWidth() || h > provider.getHeight()) |
|
606 |
throw new InvalidSetViewException("Out of image"); |
|
607 | 594 |
|
608 | 595 |
//Buffer ReadOnly |
609 | 596 |
|
610 | 597 |
if(isReadOnly()) { |
611 |
Buffer rb = DefaultRasterManager.getInstance().createReadOnlyBuffer(getDataType()[0], bufWidth, bufHeight, getBandCount()); |
|
598 |
Buffer rb = DefaultRasterManager.getInstance().createReadOnlyBuffer(getDataType()[0], |
|
599 |
q.getBufWidth(), q.getBufHeight(), getBandCount()); |
|
612 | 600 |
if(rb instanceof RasterReadOnlyBuffer) { |
613 | 601 |
try { |
614 |
((RasterReadOnlyBuffer)rb).setBufferParams((QueryableRaster)this, x, y, x + w, y + h, bandList); |
|
602 |
((RasterReadOnlyBuffer)rb).setBufferParams((QueryableRaster)this, q.getPixelX(), |
|
603 |
q.getPixelY(), q.getPixelX() + q.getPixelW(), q.getPixelY() + q.getPixelH(), bandList); |
|
615 | 604 |
} catch (FileNotExistsException e) { |
616 | 605 |
//Esto no debe darse ya que se comprueba al hacer el open. |
617 | 606 |
return null; |
... | ... | |
627 | 616 |
Buffer raster = null; |
628 | 617 |
|
629 | 618 |
if(forceToMemory) //Fuerza siempre buffer en memoria |
630 |
raster = DefaultRasterManager.getInstance().createMemoryBuffer(getDataType()[0], bufWidth, bufHeight, bandList.getDrawableBandsCount(), true);
|
|
619 |
raster = DefaultRasterManager.getInstance().createMemoryBuffer(getDataType()[0], q.getBufWidth(), q.getBufHeight(), bandList.getDrawableBandsCount(), true);
|
|
631 | 620 |
else |
632 |
raster = DefaultRasterManager.getInstance().createBuffer(getDataType()[0], bufWidth, bufHeight, bandList.getDrawableBandsCount(), true);
|
|
621 |
raster = DefaultRasterManager.getInstance().createBuffer(getDataType()[0], q.getBufWidth(), q.getBufHeight(), bandList.getDrawableBandsCount(), true);
|
|
633 | 622 |
|
634 |
raster = ((DefaultRasterProvider)provider).getWindow(x, y, w, h, bandList, raster);
|
|
623 |
raster = ((DefaultRasterProvider)provider).getWindow(q.getPixelX(), q.getPixelY(), q.getPixelW(), q.getPixelH(), bandList, raster);
|
|
635 | 624 |
|
636 | 625 |
return raster; |
637 | 626 |
} |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/AbstractRasterDataStore.java | ||
---|---|---|
102 | 102 |
/** |
103 | 103 |
* Extensi?n de los datos del buffer |
104 | 104 |
*/ |
105 |
private Extent dataExtent = null;
|
|
105 |
protected Extent dataExtent = null;
|
|
106 | 106 |
/** |
107 | 107 |
* Ancho y alto en pixeles del ?ltimo buffer asignado |
108 | 108 |
*/ |
109 | 109 |
protected double nWidth = 0; |
110 | 110 |
protected double nHeight = 0; |
111 |
private double[] step = null;
|
|
111 |
protected double[] step = null;
|
|
112 | 112 |
private Buffer lastBuffer = null; |
113 | 113 |
|
114 | 114 |
private DataManager dataManager = null; |
... | ... | |
165 | 165 |
if(q.getType() == DefaultRasterQuery.TYPE_ENTIRE) { |
166 | 166 |
step = null; |
167 | 167 |
dataExtent = getExtent(); |
168 |
buf = getWindow(0, 0, (int)getWidth(), (int)getHeight(), -1, -1); |
|
168 |
q.setAreaOfInterest(0, 0, (int)getWidth(), (int)getHeight(), -1, -1); |
|
169 |
q.setAreaOfInterest(); //Vuelve a poner el tipo correcto |
|
170 |
buf = getWindowPx(q); |
|
169 | 171 |
buf.setDataExtent( |
170 | 172 |
new Rectangle2D.Double(dataExtent.getULX(), dataExtent.getULY() - (dataExtent.getMax().getY() - dataExtent.getMin().getY()), |
171 | 173 |
dataExtent.getMax().getX() - dataExtent.getMin().getX(), |
... | ... | |
197 | 199 |
dataExtent = new ExtentImpl(q.getBBox().getULX(), q.getBBox().getULY(), |
198 | 200 |
q.getBBox().getLRX(), q.getBBox().getLRY()); |
199 | 201 |
((RasterDataParameters)getParameters()).setAlphaBand(currentQuery.getAlphaBandNumber()); |
200 |
getWindow(q.getBBox().getULX(), q.getBBox().getULY(), |
|
201 |
q.getBBox().getLRX(), q.getBBox().getLRY(), |
|
202 |
q.getBufWidth(), q.getBufHeight(), |
|
203 |
q.getTileListener()); |
|
202 |
getWindowTiled(q, q.getTileListener()); |
|
204 | 203 |
} |
205 | 204 |
|
206 | 205 |
//***************************************** |
207 | 206 |
//Pixel coordinates with and without resampling |
208 | 207 |
//***************************************** |
209 | 208 |
if(q.getType() == DefaultRasterQuery.TYPE_PX || q.getType() == DefaultRasterQuery.TYPE_PX_SIZE) { |
210 |
buf = setAreaOfInterestInPx(q);
|
|
209 |
buf = getWindowPx(q);
|
|
211 | 210 |
} |
212 | 211 |
|
213 | 212 |
result = new Object[]{buf}; |
... | ... | |
218 | 217 |
if(q.getType() == DefaultRasterQuery.TYPE_ONE_TILE) { |
219 | 218 |
if(isTiled()) { |
220 | 219 |
try { |
221 |
Tile t = getTile(q.getResolutionLevel(), q.getTileCol(), q.getTileRow(), q.getBBox(), q.getCacheStruct());
|
|
220 |
Tile t = getTile(q); |
|
222 | 221 |
result = t.getData(); |
223 | 222 |
} catch (TileGettingException e) { |
224 | 223 |
throw new RasterDriverException("Problems getting the tile", e); |
... | ... | |
247 | 246 |
} |
248 | 247 |
|
249 | 248 |
/** |
249 |
* Gets a resampled window of data using world coordinates and buffer size. |
|
250 |
* @param q |
|
251 |
* @return |
|
252 |
*/ |
|
253 |
public abstract Buffer getWindowWithResampling(DefaultRasterQuery q) throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException ; |
|
254 |
|
|
255 |
/** |
|
256 |
* Gets a resampled window of data using world. The buffer size variable will be ignored and the final size will |
|
257 |
* be calculated using the pixel size. |
|
258 |
* @param q |
|
259 |
* @return |
|
260 |
*/ |
|
261 |
public abstract Buffer getWindowWithoutResampling(DefaultRasterQuery q) throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException ; |
|
262 |
|
|
263 |
/** |
|
250 | 264 |
* Asigna el ?rea de interes en coordenadas del mundo real. Si las coordenadas exceden del tama?o de la imagen |
251 | 265 |
* estas coordenadas son ajustadas el extent. |
252 | 266 |
* @param x Coordenada X, esquina superior izquierda |
... | ... | |
262 | 276 |
step = null; |
263 | 277 |
dataExtent = new ExtentImpl(q.getX(), q.getY(), q.getX() + q.getW(), q.getY() - q.getH()); |
264 | 278 |
Extent adjustedDataExtent = util.calculateAdjustedView(dataExtent, getAffineTransform(), getWidth(), getHeight()); |
265 |
return getWindow(adjustedDataExtent.getMin().getX(), adjustedDataExtent.getMax().getY(), adjustedDataExtent.width(), adjustedDataExtent.height(), currentQuery.isAdjustToExtent()); |
|
279 |
q.setAreaOfInterest(adjustedDataExtent.getMin().getX(), adjustedDataExtent.getMax().getY(), adjustedDataExtent.width(), adjustedDataExtent.height()); |
|
280 |
q.setAdjustToExtent(currentQuery.isAdjustToExtent()); |
|
281 |
return getWindowWithoutResampling(q); |
|
266 | 282 |
} |
267 | 283 |
|
268 | 284 |
if( q.getType() == DefaultRasterQuery.TYPE_COORDS_SIZE || |
269 | 285 |
q.getType() == DefaultRasterQuery.TYPE_ONE_TILE) { |
270 | 286 |
step = null; |
271 |
dataExtent = new ExtentImpl(q.getBBox().getULX(), q.getBBox().getULY(), q.getBBox().getLRX(), q.getBBox().getLRY()); |
|
287 |
dataExtent = q.getBBox();//new ExtentImpl(q.getBBox().getULX(), q.getBBox().getULY(), q.getBBox().getLRX(), q.getBBox().getLRY());
|
|
272 | 288 |
Extent adjustedDataExtent = util.calculateAdjustedView(dataExtent, getAffineTransform(), getWidth(), getHeight()); |
273 | 289 |
|
274 | 290 |
//Caso 3D: La petici?n no se ajusta al ?rea y se rellena el exterior con NoData |
275 | 291 |
if(!currentQuery.isAdjustToExtent() && !util.isInside(dataExtent, getExtent())) { |
276 | 292 |
return requestFillingWithNoData(dataExtent, adjustedDataExtent, q.getBufWidth(), q.getBufHeight()); |
277 | 293 |
} |
294 |
|
|
295 |
q.setBBox(adjustedDataExtent); |
|
278 | 296 |
|
279 | 297 |
//Esta secci?n es para que no supersamplee el driver y pueda hacerse en el cliente |
280 | 298 |
if(!currentQuery.isSupersamplingLoadingBuffer()) { |
... | ... | |
285 | 303 |
|
286 | 304 |
if(q.getBufWidth() > Math.ceil(nWidth) && q.getBufHeight() > Math.ceil(nHeight)) { |
287 | 305 |
step = calcSteps(adjustedDataExtent.getULX(), adjustedDataExtent.getULY(), adjustedDataExtent.getLRX(), adjustedDataExtent.getLRY(), nWidth, nHeight, q.getBufWidth(), q.getBufHeight()); |
288 |
return getWindow(adjustedDataExtent.getULX(), adjustedDataExtent.getULY(), adjustedDataExtent.getLRX(), adjustedDataExtent.getLRY()); |
|
306 |
q.setBufWidth(-1); |
|
307 |
q.setBufHeight(-1); |
|
308 |
return getWindowWC(q); |
|
289 | 309 |
} |
290 | 310 |
} |
291 |
return getWindow(adjustedDataExtent.getULX(), adjustedDataExtent.getULY(), adjustedDataExtent.getLRX(), adjustedDataExtent.getLRY(), q.getBufWidth(), q.getBufHeight(), true /*Siempre ajustado*/); |
|
311 |
q.setAdjustToExtent(true); |
|
312 |
return getWindowWithResampling(q); |
|
292 | 313 |
} |
293 | 314 |
return null; |
294 | 315 |
} |
295 | 316 |
|
296 |
/** |
|
297 |
* Asigna el ?rea de interes en coordenadas pixel. Esta operaci?n cargar? un RasterBuffer con los datos solicitados por |
|
298 |
* lo que, si al acabar hacemos getRasterBuf obtendremos la matriz de datos. Si las coordenadas exceden del tama๏ฟฝo |
|
299 |
* de la imagen lanza una excepci?n. |
|
300 |
* @param x Coordenada X, esquina superior izquierda |
|
301 |
* @param y Coordenada Y, esquina superior izquierda |
|
302 |
* @param w Ancho del ?rea |
|
303 |
* @param h Alto del ?rea |
|
304 |
* @param bufWidth Ancho del buffer |
|
305 |
* @param bufHeight Alto del buffer |
|
306 |
* @throws ArrayIndexOutOfBoundsException |
|
307 |
*/ |
|
308 |
protected Buffer setAreaOfInterestInPx(DefaultRasterQuery q) |
|
309 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
|
310 |
step = null; |
|
311 |
if(q.getPixelX() > getSourceWidth() || q.getPixelY() > getSourceHeight()) |
|
312 |
throw new InvalidSetViewException("Wrong parameters in setAreaOfInterest"); |
|
313 |
|
|
314 |
int x = (q.getPixelX() < 0) ? 0 : q.getPixelX(); |
|
315 |
int y = (q.getPixelY() < 0) ? 0 : q.getPixelY(); |
|
316 |
int w = (q.getPixelW() > getSourceWidth()) ? getSourceWidth() : q.getPixelW(); |
|
317 |
int h = (q.getPixelH() > getSourceHeight()) ? getSourceHeight() : q.getPixelH(); |
|
318 |
|
|
319 |
dataExtent = new ExtentImpl(rasterToWorld(new Point2D.Double(x, y)), |
|
320 |
rasterToWorld(new Point2D.Double(x + w, y + h))); |
|
321 |
|
|
322 |
if(q.getType() == DefaultRasterQuery.TYPE_PX) |
|
323 |
return getWindow(x, y, w, h, -1, -1); |
|
324 |
if(q.getType() == DefaultRasterQuery.TYPE_PX_SIZE) |
|
325 |
return getWindow(x, y, w, h, q.getBufWidth(), q.getBufHeight()); |
|
326 |
return null; |
|
327 |
} |
|
328 |
|
|
329 | 317 |
/* |
330 | 318 |
* (non-Javadoc) |
331 | 319 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getAdjustedToExtent(org.gvsig.fmap.dal.coverage.datastruct.Extent) |
... | ... | |
448 | 436 |
int copyX = (int)Math.abs(endPxX - initPxX); |
449 | 437 |
int copyY = (int)Math.abs(endPxY - initPxY); |
450 | 438 |
|
451 |
Buffer rasterBuf = getWindow(fitExtent.getULX(), fitExtent.getULY(), fitExtent.getLRX(), fitExtent.getLRY(), copyX, copyY, true); |
|
439 |
DefaultRasterQuery q = (DefaultRasterQuery)RasterLocator.getManager().createQuery(); |
|
440 |
q.setBBox(fitExtent); |
|
441 |
q.setBufWidth(copyX); |
|
442 |
q.setBufHeight(copyY); |
|
443 |
q.setAdjustToExtent(true); |
|
444 |
Buffer rasterBuf = getWindowWithResampling(q); |
|
445 |
|
|
452 | 446 |
Buffer buf = DefaultRasterManager.getInstance().createBuffer(getDataType()[0], bufWidth, bufHeight, rasterBuf.getBandCount(), true); |
453 | 447 |
buf.setNoDataValue(currentQuery.getNoDataValueToFill()); |
454 | 448 |
for(int i = 0; i < buf.getBandCount(); i++) { |
... | ... | |
582 | 576 |
public void setRender(Render render) { |
583 | 577 |
this.render = render; |
584 | 578 |
} |
585 |
|
|
586 |
/** |
|
587 |
* Obtiene la altura de la fuente de datos. |
|
588 |
* @return altura en celdas del grid. |
|
589 |
*/ |
|
590 |
private int getSourceHeight() { |
|
591 |
return (int)getHeight(); |
|
592 |
} |
|
593 | 579 |
|
594 |
/** |
|
595 |
* Obtiene la anchura de la fuente de datos. |
|
596 |
* @return anchura en celdas del grid. |
|
597 |
*/ |
|
598 |
private int getSourceWidth() { |
|
599 |
return (int)getWidth(); |
|
600 |
} |
|
601 | 580 |
|
602 | 581 |
/* |
603 | 582 |
* (non-Javadoc) |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultRemoteRasterStore.java | ||
---|---|---|
48 | 48 |
import org.gvsig.raster.impl.DefaultRasterManager; |
49 | 49 |
import org.gvsig.raster.impl.buffer.DefaultRasterQuery; |
50 | 50 |
import org.gvsig.raster.impl.datastruct.BandListImpl; |
51 |
import org.gvsig.raster.impl.datastruct.ExtentImpl; |
|
52 | 51 |
import org.gvsig.raster.impl.provider.DefaultRasterProvider; |
53 | 52 |
import org.gvsig.raster.impl.provider.RasterProvider; |
54 | 53 |
import org.gvsig.raster.impl.provider.TiledRasterProvider; |
... | ... | |
111 | 110 |
protected Buffer setAreaOfInterestInWC(DefaultRasterQuery q) |
112 | 111 |
throws RasterDriverException, InvalidSetViewException, ProcessInterruptedException { |
113 | 112 |
if(q.getType() == DefaultRasterQuery.TYPE_COORDS) { |
114 |
return getWindow(q.getX(), q.getY(), q.getW(), q.getH(), currentQuery.isAdjustToExtent()); |
|
113 |
q.setAdjustToExtent(currentQuery.isAdjustToExtent()); |
|
114 |
return getWindowWithoutResampling(q); |
|
115 | 115 |
} |
116 | 116 |
|
117 | 117 |
if( q.getType() == DefaultRasterQuery.TYPE_COORDS_SIZE || |
118 | 118 |
q.getType() == DefaultRasterQuery.TYPE_ONE_TILE) { |
119 |
if(getParameters() instanceof RemoteStoreParameters && ((RemoteStoreParameters)getParameters()).isSizeFixed()) |
|
120 |
return super.getWindow(q.getBBox().getULX(), q.getBBox().getULY(), q.getBBox().getLRX(), q.getBBox().getLRY(), q.getBufWidth(), q.getBufHeight(), true); |
|
121 |
else |
|
122 |
return getWindow(q.getBBox().getULX(), q.getBBox().getULY(), q.getBBox().getLRX(), q.getBBox().getLRY(), q.getBufWidth(), q.getBufHeight(), true); |
|
119 |
q.setAdjustToExtent(true); |
|
120 |
return super.getWindowWithResampling(q); |
|
121 |
/*if(getParameters() instanceof RemoteStoreParameters && ((RemoteStoreParameters)getParameters()).isSizeFixed()) { |
|
122 |
q.setAdjustToExtent(true); |
|
123 |
return super.getResampledWindow(q); |
|
124 |
} else |
|
125 |
return getWindow(q.getBBox().getULX(), q.getBBox().getULY(), q.getBBox().getLRX(), q.getBBox().getLRY(), q.getBufWidth(), q.getBufHeight(), true);*/ |
|
123 | 126 |
} |
124 | 127 |
|
125 | 128 |
return null; |
126 | 129 |
} |
127 |
|
|
128 |
/* |
|
129 |
* (non-Javadoc) |
|
130 |
* @see org.gvsig.raster.impl.store.AbstractRasterDataStore#setAreaOfInterest(int, int, int, int, int, int) |
|
131 |
*/ |
|
132 |
@Override |
|
133 |
protected Buffer setAreaOfInterestInPx(DefaultRasterQuery q) |
|
134 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
|
135 |
if(q.getType() == DefaultRasterQuery.TYPE_PX) { |
|
136 |
if(((RemoteStoreParameters)getParameters()).isSizeFixed()) |
|
137 |
return super.getWindow(q.getPixelX(), q.getPixelY(), q.getPixelW(), q.getPixelH()); |
|
138 |
else |
|
139 |
return getWindow(q.getPixelX(), q.getPixelY(), q.getPixelW(), q.getPixelH()); |
|
140 |
} |
|
141 |
if(q.getType() == DefaultRasterQuery.TYPE_PX_SIZE) { |
|
142 |
if(((RemoteStoreParameters)getParameters()).isSizeFixed()) |
|
143 |
return super.getWindow(q.getPixelX(), q.getPixelY(), q.getPixelW(), q.getPixelH(), q.getBufWidth(), q.getBufHeight()); |
|
144 |
else |
|
145 |
return getWindow(q.getPixelX(), q.getPixelY(), q.getPixelW(), q.getPixelH(), q.getBufWidth(), q.getBufHeight()); |
|
146 |
} |
|
147 |
return null; |
|
148 |
} |
|
149 | 130 |
|
150 | 131 |
/* |
151 | 132 |
* (non-Javadoc) |
152 | 133 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getWindowRaster(double, double, double, double) |
153 | 134 |
*/ |
154 |
public Buffer getWindow(double ulx, double uly, double lrx, double lry)
|
|
135 |
public Buffer getWindowWC(DefaultRasterQuery q)
|
|
155 | 136 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
156 | 137 |
|
157 | 138 |
//Leemos pixels completos aunque el valor obtenido sea decimal. Esto se consigue redondeando |
158 | 139 |
//por arriba el m?s alto y por abajo el menor y luego restandolos |
159 | 140 |
|
160 |
Point2D p1 = provider.worldToRaster(new Point2D.Double(ulx, uly));
|
|
161 |
Point2D p2 = provider.worldToRaster(new Point2D.Double(lrx, lry));
|
|
141 |
Point2D p1 = provider.worldToRaster(new Point2D.Double(q.getBBox().getULX(), q.getBBox().getULY()));
|
|
142 |
Point2D p2 = provider.worldToRaster(new Point2D.Double(q.getBBox().getLRX(), q.getBBox().getLRY()));
|
|
162 | 143 |
|
163 | 144 |
//Para el valor mayor redondeamos por arriba. Para el valor menor redondeamos por abajo. |
164 | 145 |
double p1X = (p1.getX() > p2.getX()) ? Math.ceil(p1.getX()) : Math.floor(p1.getX()); |
... | ... | |
202 | 183 |
* (non-Javadoc) |
203 | 184 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getWindowRaster(double, double, double, double, boolean) |
204 | 185 |
*/ |
205 |
public Buffer getWindow(double ulx, double uly, double w, double h, boolean adjustToExtent)
|
|
186 |
public Buffer getWindowWithoutResampling(DefaultRasterQuery q)
|
|
206 | 187 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
207 | 188 |
//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 |
208 | 189 |
//tenemos que averiguar si lrx es x + w o x -w, asi como si lry es y + h o y - h |
... | ... | |
211 | 192 |
Point2D pEnd = provider.rasterToWorld(new Point2D.Double((int)getWidth(), (int)getHeight())); |
212 | 193 |
double wRaster = Math.abs(pEnd.getX() - pInit.getX()); |
213 | 194 |
double hRaster = Math.abs(pEnd.getY() - pInit.getY()); |
214 |
double lrx = (((int)(ext.getULX() - wRaster)) == ((int)ext.getLRX())) ? (ulx - w) : (ulx + w);
|
|
215 |
double lry = (((int)(ext.getULY() - hRaster)) == ((int)ext.getLRY())) ? (uly - h) : (uly + h);
|
|
195 |
double lrx = (((int)(ext.getULX() - wRaster)) == ((int)ext.getLRX())) ? (q.getX() - q.getW()) : (q.getX() + q.getW());
|
|
196 |
double lry = (((int)(ext.getULY() - hRaster)) == ((int)ext.getLRY())) ? (q.getY() - q.getH()) : (q.getY() + q.getH());
|
|
216 | 197 |
|
217 | 198 |
//Leemos pixels completos aunque el valor obtenido sea decimal. Esto se consigue redondeando |
218 | 199 |
//por arriba el m?s alto y por abajo el menor y luego restandolos |
219 | 200 |
|
220 |
Point2D p1 = provider.worldToRaster(new Point2D.Double(ulx, uly));
|
|
201 |
Point2D p1 = provider.worldToRaster(new Point2D.Double(q.getX(), q.getY()));
|
|
221 | 202 |
Point2D p2 = provider.worldToRaster(new Point2D.Double(lrx, lry)); |
222 | 203 |
int width = (int)Math.abs(Math.ceil(p2.getX()) - Math.floor(p1.getX())); |
223 | 204 |
int height = (int)Math.abs(Math.floor(p1.getY()) - Math.ceil(p2.getY())); |
... | ... | |
247 | 228 |
Point2D wc1 = provider.rasterToWorld(new Point2D.Double(Math.floor(p1.getX()), Math.floor(p1.getY()))); |
248 | 229 |
Point2D wc2 = provider.rasterToWorld(new Point2D.Double(Math.ceil(p2.getX()), Math.ceil(p2.getY()))); |
249 | 230 |
Buffer buffer = DefaultRasterManager.getInstance().createMemoryBuffer(provider.getDataType()[0], width, height, provider.getBandCount(), true); |
250 |
return ((DefaultRasterProvider)provider).getWindow(wc1.getX(), wc1.getY(), Math.abs(wc2.getX() - wc1.getX()), Math.abs(wc2.getY() - wc1.getY()), bandList, buffer, adjustToExtent);
|
|
231 |
return ((DefaultRasterProvider)provider).getWindow(wc1.getX(), wc1.getY(), Math.abs(wc2.getX() - wc1.getX()), Math.abs(wc2.getY() - wc1.getY()), bandList, buffer, q.isAdjustToExtent());
|
|
251 | 232 |
} |
252 | 233 |
|
253 | 234 |
/* |
254 | 235 |
* (non-Javadoc) |
255 | 236 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getWindowRaster(double, double, double, double, int, int, org.gvsig.fmap.dal.coverage.grid.render.TileListener, int) |
256 | 237 |
*/ |
257 |
public void getWindow(double ulx, double uly, double lrx, double lry, |
|
258 |
int bufWidth, int bufHeight, TileListener listener) |
|
238 |
public void getWindowTiled(DefaultRasterQuery q, TileListener listener) |
|
259 | 239 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
260 |
Extent ex = new ExtentImpl(ulx, uly, lrx, lry); |
|
261 |
((DefaultRasterProvider)provider).getWindow(ex, bufWidth, bufHeight, bandList, listener); |
|
240 |
((DefaultRasterProvider)provider).getWindow(q.getBBox(), q.getBufWidth(), q.getBufHeight(), bandList, listener); |
|
262 | 241 |
} |
263 | 242 |
|
264 | 243 |
/* |
265 | 244 |
* (non-Javadoc) |
266 | 245 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getWindowRaster(double, double, double, double, int, int, boolean) |
267 | 246 |
*/ |
268 |
public Buffer getWindow(double ulx, double uly, double lrx, double lry, int bufWidth, int bufHeight, boolean adjustToExtent)
|
|
247 |
public Buffer getWindowWithResampling(DefaultRasterQuery q)
|
|
269 | 248 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
270 | 249 |
int mallocNBands = 0; |
271 | 250 |
if(bandList.getDrawableBands() != null) |
... | ... | |
274 | 253 |
mallocNBands = bandList.getDrawableBandsCount(); |
275 | 254 |
|
276 | 255 |
int dataType = provider.getDataType()[0]; |
277 |
Buffer buffer = DefaultRasterManager.getInstance().createMemoryBuffer(dataType, bufWidth, bufHeight, mallocNBands, true); |
|
278 |
Extent ex = rManager.getDataStructFactory().createExtent(ulx, uly, lrx, lry); |
|
279 |
return ((DefaultRasterProvider)provider).getWindow(ex, bufWidth, bufHeight, bandList, buffer, adjustToExtent); |
|
256 |
Buffer buffer = DefaultRasterManager.getInstance().createMemoryBuffer(dataType, q.getBufWidth(), q.getBufHeight(), mallocNBands, true); |
|
257 |
return ((DefaultRasterProvider)provider).getWindow(q.getBBox(), q.getBufWidth(), q.getBufHeight(), bandList, buffer, q.isAdjustToExtent()); |
|
280 | 258 |
} |
281 | 259 |
|
282 | 260 |
/* |
283 | 261 |
* (non-Javadoc) |
284 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getWindowRaster(int, int, int, int) |
|
285 |
*/ |
|
286 |
// public Buffer getWindow(int x, int y, int w, int h) |
|
287 |
// throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
|
288 |
// if(x < 0 || y < 0 || w > provider.getWidth() || h > provider.getHeight()) |
|
289 |
// throw new InvalidSetViewException("Out of image"); |
|
290 |
// |
|
291 |
// Buffer buffer = DefaultRasterManager.getInstance().createMemoryBuffer(provider.getDataType()[0], w, h, provider.getBandCount(), true); |
|
292 |
// return ((DefaultRasterProvider)provider).getWindow(x, y, bandList, buffer); |
|
293 |
// } |
|
294 |
|
|
295 |
/* |
|
296 |
* (non-Javadoc) |
|
297 | 262 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getWindowRaster(int, int, int, int, int, int) |
298 | 263 |
*/ |
299 |
public Buffer getWindow(int x, int y, int w, int h, int bufWidth, int bufHeight)
|
|
264 |
public Buffer getWindowPx(DefaultRasterQuery q)
|
|
300 | 265 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
301 |
if(bufWidth < 0 || bufHeight < 0) { |
|
302 |
bufWidth = w; |
|
303 |
bufHeight = h; |
|
304 |
} |
|
305 |
|
|
306 |
if(x < 0 || y < 0 || w > provider.getWidth() || h > provider.getHeight()) |
|
266 |
if(q.getPixelX() < 0 || q.getPixelY() < 0 || q.getPixelW() > getWidth() || q.getPixelH() > getHeight()) |
|
307 | 267 |
throw new InvalidSetViewException("Out of image"); |
308 | 268 |
|
309 |
Buffer buffer = DefaultRasterManager.getInstance().createMemoryBuffer(provider.getDataType()[0], bufWidth, bufHeight, provider.getBandCount(), true); |
|
310 |
return ((DefaultRasterProvider)provider).getWindow(x, y, w, h, bandList, buffer); |
|
269 |
if( q.getType() == DefaultRasterQuery.TYPE_PX || |
|
270 |
q.getType() == DefaultRasterQuery.TYPE_ENTIRE || |
|
271 |
q.getBufWidth() <= 0 || q.getBufHeight() <= 0) { |
|
272 |
q.setBufWidth(q.getPixelW()); |
|
273 |
q.setBufHeight(q.getPixelH()); |
|
274 |
//TODO: Pruebas con SizeFixed |
|
275 |
/*if(((RemoteStoreParameters)getParameters()).isSizeFixed()) |
|
276 |
return super.getWindow(q.getPixelX(), q.getPixelY(), q.getPixelW(), q.getPixelH()); |
|
277 |
else |
|
278 |
return getWindow(q.getPixelX(), q.getPixelY(), q.getPixelW(), q.getPixelH());*/ |
|
279 |
} |
|
280 |
|
|
281 |
Buffer buffer = DefaultRasterManager.getInstance().createMemoryBuffer(provider.getDataType()[0], |
|
282 |
q.getBufWidth(), q.getBufHeight(), provider.getBandCount(), true); |
|
283 |
return ((DefaultRasterProvider)provider).getWindow(q.getPixelX(), q.getPixelY(), q.getPixelW(), q.getPixelH(), bandList, buffer); |
|
311 | 284 |
} |
312 | 285 |
|
313 | 286 |
|
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/QueryableRaster.java | ||
---|---|---|
35 | 35 |
import org.gvsig.fmap.dal.coverage.store.props.ColorTable; |
36 | 36 |
import org.gvsig.raster.cache.tile.Tile; |
37 | 37 |
import org.gvsig.raster.cache.tile.exception.TileGettingException; |
38 |
import org.gvsig.raster.cache.tile.provider.CacheStruct; |
|
39 | 38 |
import org.gvsig.raster.cache.tile.provider.TileListener; |
39 |
import org.gvsig.raster.impl.buffer.DefaultRasterQuery; |
|
40 | 40 |
|
41 | 41 |
|
42 | 42 |
|
... | ... | |
167 | 167 |
public void setMemoryBuffer(boolean memoryBuffer); |
168 | 168 |
|
169 | 169 |
/** |
170 |
* Gets a tile of data if the provider is able to return a tile |
|
171 |
* @param wPx |
|
172 |
* @param hPx |
|
173 |
* @param row |
|
174 |
* @param col |
|
175 |
* @param bbox |
|
176 |
* @param cacheStruct |
|
177 |
* The client CacheStruct or null to use the preferred CacheStruct |
|
178 |
* @return |
|
179 |
* @throws TileGettingException |
|
170 |
* Gets a window of data |
|
171 |
* @param q |
|
172 |
* @return |
|
173 |
* @throws InvalidSetViewException |
|
174 |
* @throws ProcessInterruptedException |
|
175 |
* @throws RasterDriverException |
|
180 | 176 |
*/ |
181 |
public Tile getTile(int leve, int row, int col, Extent bbox, CacheStruct cacheStruct) throws TileGettingException; |
|
182 |
|
|
183 |
/** |
|
184 |
* Obtiene una ventana de datos de la imagen a partir de coordenadas reales. |
|
185 |
* Aplica supersampleo o subsampleo en funci?n del tama?o del buffer. Esta operaci?n la gestiona |
|
186 |
* el driver. |
|
187 |
* @param minX Valor m?nimo de la X en coordenadas reales |
|
188 |
* @param minY Valor m?nimo de la Y en coordenadas reales |
|
189 |
* @param maxX Valor m?ximo de la X en coordenadas reales |
|
190 |
* @param maxY Valor m?ximo de la Y en coordenadas reales |
|
191 |
* @param bufWidth ancho del buffer lde datos |
|
192 |
* @param bufHeight alto del buffer de datos |
|
193 |
* @param listener |
|
194 |
* @param frameInPx |
|
195 |
* @return Buffer de datos |
|
196 |
*/ |
|
197 |
public void getWindow(double ulx, double uly, double lrx, double lry, int bufWidth, int bufHeight, TileListener listener) |
|
177 |
public Buffer getWindowWC(DefaultRasterQuery q) |
|
198 | 178 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException; |
199 | 179 |
|
200 |
/** |
|
201 |
* Obtiene una ventana de datos de la imagen a partir de coordenadas reales. |
|
202 |
* No aplica supersampleo ni subsampleo sino que devuelve una matriz de igual tama?o a los |
|
203 |
* pixeles de disco. |
|
204 |
* @param x Posici?n X superior izquierda |
|
205 |
* @param y Posici?n Y superior izquierda |
|
206 |
* @param w Ancho en coordenadas reales |
|
207 |
* @param h Alto en coordenadas reales |
|
208 |
* @param adjustToExtent Flag que dice si el extent solicitado debe ajustarse al extent del raster o no. |
|
209 |
* @param bandList |
|
210 |
* @return Buffer de datos |
|
211 |
*/ |
|
212 |
public Buffer getWindow(double ulx, double uly, double lrx, double lry) |
|
213 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException; |
|
214 | 180 |
|
215 | 181 |
/** |
216 |
* Obtiene una ventana de datos de la imagen a partir de coordenadas reales. |
|
217 |
* No aplica supersampleo ni subsampleo sino que devuelve una matriz de igual tama?o a los |
|
218 |
* pixeles de disco. |
|
219 |
* @param x Posici?n X superior izquierda |
|
220 |
* @param y Posici?n Y superior izquierda |
|
221 |
* @param w Ancho en coordenadas reales |
|
222 |
* @param h Alto en coordenadas reales |
|
223 |
* @param adjustToExtent Flag que dice si el extent solicitado debe ajustarse al extent del raster o no. |
|
224 |
* @param bandList |
|
225 |
* @return Buffer de datos |
|
182 |
* Gets a windows of data from a tiled source. The listener will receive tiles. |
|
183 |
* @param q query object |
|
184 |
* @param listener |
|
226 | 185 |
*/ |
227 |
public Buffer getWindow(double ulx, double uly, double w, double h, boolean adjustToExtent)
|
|
186 |
public void getWindowTiled(DefaultRasterQuery q, TileListener listener)
|
|
228 | 187 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException; |
229 | 188 |
|
230 | 189 |
/** |
231 |
* Obtiene una ventana de datos de la imagen a partir de coordenadas reales. |
|
232 |
* Aplica supersampleo o subsampleo en funci?n del tama?o del buffer. Esta operaci?n la gestiona |
|
233 |
* el driver. |
|
234 |
* @param minX Valor m?nimo de la X en coordenadas reales |
|
235 |
* @param minY Valor m?nimo de la Y en coordenadas reales |
|
236 |
* @param maxX Valor m?ximo de la X en coordenadas reales |
|
237 |
* @param maxY Valor m?ximo de la Y en coordenadas reales |
|
238 |
* @param bufWidth ancho del buffer lde datos |
|
239 |
* @param bufHeight alto del buffer de datos |
|
240 |
* @param adjustToExtent Flag que dice si el extent solicitado debe ajustarse al extent del raster o no. |
|
241 |
* @param bandList |
|
242 |
* @return Buffer de datos |
|
190 |
* Gets a window of data |
|
191 |
* @param q query object |
|
243 | 192 |
*/ |
244 |
public Buffer getWindow(double ulx, double uly, double lrx, double lry, int bufWidth, int bufHeight, boolean adjustToExtent)
|
|
193 |
public Buffer getWindowPx(DefaultRasterQuery q)
|
|
245 | 194 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException; |
246 | 195 |
|
247 |
|
|
248 | 196 |
/** |
249 |
* Obtiene una ventana de datos de la imagen a partir de coordenadas reales.
|
|
250 |
* Aplica supersampleo o subsampleo en funci?n del tama?o del buffer
|
|
251 |
* @param x Posici?n X superior izquierda en pixels
|
|
252 |
* @param y Posici?n Y superior izquierda en pixels
|
|
253 |
* @param w Ancho en pixels
|
|
254 |
* @param h Alto en pixels
|
|
255 |
* @param bufWidth ancho del buffer de datos
|
|
256 |
* @param bufHeight alto del buffer de datos
|
|
257 |
* @param bandList
|
|
258 |
* @return Buffer de datos
|
|
197 |
* Gets a tile of data if the provider is able to return a tile
|
|
198 |
* @param wPx
|
|
199 |
* @param hPx
|
|
200 |
* @param row
|
|
201 |
* @param col
|
|
202 |
* @param bbox
|
|
203 |
* @param cacheStruct
|
|
204 |
* The client CacheStruct or null to use the preferred CacheStruct
|
|
205 |
* @return
|
|
206 |
* @throws TileGettingException
|
|
259 | 207 |
*/ |
260 |
public Buffer getWindow(int x, int y, int w, int h, int bufWidth, int bufHeight) |
|
261 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException; |
|
208 |
public Tile getTile(DefaultRasterQuery q) throws TileGettingException; |
|
262 | 209 |
|
263 | 210 |
/** |
264 | 211 |
* Dado unas coordenadas reales, un tama?o de buffer y un tama?o de raster. |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/DefaultRasterQuery.java | ||
---|---|---|
345 | 345 |
public int getPixelH() { |
346 | 346 |
return pixelH; |
347 | 347 |
} |
348 |
|
|
349 |
public void setPixelX(int x) { |
|
350 |
pixelX = x; |
|
351 |
} |
|
348 | 352 |
|
353 |
public void setPixelY(int y) { |
|
354 |
pixelY = y; |
|
355 |
} |
|
356 |
|
|
357 |
public void setPixelW(int w) { |
|
358 |
pixelW = w; |
|
359 |
} |
|
360 |
|
|
361 |
public void setPixelH(int h) { |
|
362 |
pixelH = h; |
|
363 |
} |
|
364 |
|
|
349 | 365 |
public Extent getBBox() { |
350 | 366 |
return bbox; |
351 | 367 |
} |
368 |
|
|
369 |
public void setBBox(Extent bbox) { |
|
370 |
this.bbox = bbox; |
|
371 |
} |
|
352 | 372 |
|
353 | 373 |
public int getBufWidth() { |
354 | 374 |
return bufWidth; |
... | ... | |
357 | 377 |
public int getBufHeight() { |
358 | 378 |
return bufHeight; |
359 | 379 |
} |
380 |
|
|
381 |
public void setBufHeight(int h) { |
|
382 |
bufHeight = h; |
|
383 |
} |
|
384 |
|
|
385 |
public void setBufWidth(int w) { |
|
386 |
bufWidth = w; |
|
387 |
} |
|
360 | 388 |
|
361 | 389 |
public boolean isReadOnly() { |
362 | 390 |
return readOnly; |
... | ... | |
397 | 425 |
public CacheStruct getCacheStruct() { |
398 | 426 |
return cacheStruct; |
399 | 427 |
} |
428 |
|
|
429 |
public void setCacheStruct(CacheStruct cacheStruct) { |
|
430 |
this.cacheStruct = cacheStruct; |
|
431 |
} |
|
400 | 432 |
|
401 | 433 |
public int getResolutionLevel() { |
402 | 434 |
return resolutionLevel; |
org.gvsig.raster.netcdf/trunk/org.gvsig.raster.netcdf/org.gvsig.raster.netcdf.io/src/main/java/org/gvsig/raster/netcdf/io/NetCDFProvider.java | ||
---|---|---|
40 | 40 |
import org.gvsig.fmap.dal.coverage.exception.ParsingException; |
41 | 41 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
42 | 42 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
43 |
import org.gvsig.fmap.dal.coverage.store.RasterQuery; |
|
43 | 44 |
import org.gvsig.fmap.dal.coverage.store.parameter.RasterFileStoreParameters; |
44 | 45 |
import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation; |
45 | 46 |
import org.gvsig.fmap.dal.exception.OpenException; |
... | ... | |
630 | 631 |
i - (auxRow * buf.getWidth()) |
631 | 632 |
}; |
632 | 633 |
} |
634 |
|
|
635 |
/* |
|
636 |
* (non-Javadoc) |
|
637 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getDataSet(org.gvsig.fmap.dal.coverage.store.RasterQuery) |
|
638 |
*/ |
|
639 |
public Buffer getDataSet(RasterQuery q) { |
|
640 |
return null; |
|
641 |
} |
|
633 | 642 |
|
634 | 643 |
/* |
635 | 644 |
* (non-Javadoc) |
org.gvsig.raster.wms/trunk/org.gvsig.raster.wms/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/WMSProvider.java | ||
---|---|---|
47 | 47 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
48 | 48 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
49 | 49 |
import org.gvsig.fmap.dal.coverage.exception.RemoteServiceException; |
50 |
import org.gvsig.fmap.dal.coverage.store.RasterQuery; |
|
50 | 51 |
import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation; |
51 | 52 |
import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer; |
52 | 53 |
import org.gvsig.fmap.dal.coverage.store.props.Transparency; |
... | ... | |
686 | 687 |
|
687 | 688 |
/* |
688 | 689 |
* (non-Javadoc) |
690 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getDataSet(org.gvsig.fmap.dal.coverage.store.RasterQuery) |
|
691 |
*/ |
|
692 |
public Buffer getDataSet(RasterQuery q) { |
|
693 |
return null; |
|
694 |
} |
|
695 |
|
|
696 |
/* |
|
697 |
* (non-Javadoc) |
|
689 | 698 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(org.gvsig.fmap.dal.coverage.datastruct.Extent, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.raster.cache.tile.provider.TileListener) |
690 | 699 |
*/ |
691 | 700 |
public void getWindow(Extent ex, int bufWidth, int bufHeight, |
org.gvsig.raster.gdal/trunk/org.gvsig.raster.gdal/org.gvsig.raster.gdal.io/src/main/java/org/gvsig/raster/gdal/io/GdalProvider.java | ||
---|---|---|
44 | 44 |
import org.gvsig.fmap.dal.coverage.exception.ParsingException; |
45 | 45 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
46 | 46 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
47 |
import org.gvsig.fmap.dal.coverage.store.RasterQuery; |
|
47 | 48 |
import org.gvsig.fmap.dal.coverage.store.props.Transparency; |
48 | 49 |
import org.gvsig.fmap.dal.spi.DataManagerProviderServices; |
49 | 50 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
... | ... | |
428 | 429 |
|
429 | 430 |
/* |
430 | 431 |
* (non-Javadoc) |
432 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getDataSet(org.gvsig.fmap.dal.coverage.store.RasterQuery) |
|
433 |
*/ |
|
434 |
public Buffer getDataSet(RasterQuery q) { |
|
435 |
return null; |
|
436 |
} |
|
437 |
|
|
438 |
/* |
|
439 |
* (non-Javadoc) |
|
431 | 440 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(double, double, double, double, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.raster.cache.tile.provider.TileListener) |
432 | 441 |
*/ |
433 | 442 |
public void getWindow(Extent ex, int bufWidth, int bufHeight, |
org.gvsig.raster.gdal/trunk/org.gvsig.raster.gdal/org.gvsig.raster.gdal.io/src/main/java/org/gvsig/raster/memory/io/MemoryRasterProvider.java | ||
---|---|---|
35 | 35 |
import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException; |
36 | 36 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
37 | 37 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
38 |
import org.gvsig.fmap.dal.coverage.store.RasterQuery; |
|
38 | 39 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
39 | 40 |
import org.gvsig.metadata.MetadataLocator; |
40 | 41 |
import org.gvsig.raster.cache.tile.provider.TileListener; |
... | ... | |
275 | 276 |
|
276 | 277 |
/* |
277 | 278 |
* (non-Javadoc) |
279 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getDataSet(org.gvsig.fmap.dal.coverage.store.RasterQuery) |
|
280 |
*/ |
|
281 |
public Buffer getDataSet(RasterQuery q) { |
|
282 |
return null; |
|
283 |
} |
|
284 |
|
|
285 |
/* |
|
286 |
* (non-Javadoc) |
|
278 | 287 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(org.gvsig.fmap.dal.coverage.datastruct.Extent, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.raster.cache.tile.provider.TileListener) |
279 | 288 |
*/ |
280 | 289 |
public void getWindow(Extent ex, int bufWidth, int bufHeight, |
org.gvsig.raster.ermapper/trunk/org.gvsig.raster.ermapper/org.gvsig.raster.ermapper.io/src/main/java/org/gvsig/raster/ermapper/io/ErmapperProvider.java | ||
---|---|---|
40 | 40 |
import org.gvsig.fmap.dal.coverage.exception.ParsingException; |
41 | 41 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
42 | 42 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
43 |
import org.gvsig.fmap.dal.coverage.store.RasterQuery; |
|
43 | 44 |
import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters; |
44 | 45 |
import org.gvsig.fmap.dal.coverage.store.parameter.RasterFileStoreParameters; |
45 | 46 |
import org.gvsig.fmap.dal.coverage.store.props.Transparency; |
... | ... | |
277 | 278 |
|
278 | 279 |
/* |
279 | 280 |
* (non-Javadoc) |
281 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getDataSet(org.gvsig.fmap.dal.coverage.store.RasterQuery) |
|
282 |
*/ |
|
283 |
public Buffer getDataSet(RasterQuery q) { |
|
284 |
return null; |
|
285 |
} |
|
286 |
|
|
287 |
/* |
|
288 |
* (non-Javadoc) |
|
280 | 289 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(double, double, double, double, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.raster.cache.tile.provider.TileListener) |
Also available in: Unified diff