Revision 2438 org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterQuery.java
RasterQuery.java | ||
---|---|---|
21 | 21 |
*/ |
22 | 22 |
package org.gvsig.fmap.dal.coverage.store; |
23 | 23 |
|
24 |
import java.awt.Rectangle; |
|
25 |
|
|
24 | 26 |
import org.gvsig.fmap.dal.DataQuery; |
27 |
import org.gvsig.fmap.dal.coverage.dataset.Buffer; |
|
25 | 28 |
import org.gvsig.fmap.dal.coverage.datastruct.Extent; |
26 | 29 |
import org.gvsig.fmap.dal.coverage.datastruct.NoData; |
27 |
import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
|
|
30 |
import org.gvsig.fmap.dal.coverage.exception.QueryException;
|
|
28 | 31 |
import org.gvsig.raster.cache.tile.provider.CacheStruct; |
29 | 32 |
import org.gvsig.raster.cache.tile.provider.TileListener; |
30 | 33 |
import org.gvsig.timesupport.Time; |
31 | 34 |
import org.gvsig.tools.task.TaskStatus; |
32 | 35 |
|
33 | 36 |
/** |
34 |
* Interfaz que contiene las operaciones que debe soportar la carga de datos |
|
35 |
* raster en un buffer. |
|
37 |
* Parameters to load data from a raster data source. |
|
38 |
* <P>Use cases:</P> |
|
39 |
* <UL> |
|
40 |
* <LI>Select a window of pixels</LI> |
|
41 |
* <LI>Select a window of pixels with resampling</LI> |
|
42 |
* <LI>Select a bounding box</LI> |
|
43 |
* <LI>Select a bounding box with resampling</LI> |
|
44 |
* <LI>Enable or disable supersampling in all request above described</LI> |
|
45 |
* <LI>Adjust the request to the source limits or builds a buffer with a frame filled with nodata values (In all request above described)</LI> |
|
46 |
* <LI>All data in a buffer of the same size that the source</LI> |
|
47 |
* <LI>Select a bounding box and tiled the request</LI> |
|
48 |
* <LI>Get one tile</LI> |
|
49 |
* <LI></LI> |
|
50 |
* </UL> |
|
36 | 51 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
37 | 52 |
*/ |
38 | 53 |
public interface RasterQuery extends DataQuery { |
39 | 54 |
|
55 |
public void setAreaOfInterest(); |
|
56 |
|
|
57 |
public void setAreaOfInterest(Rectangle pixelWindow); |
|
58 |
|
|
59 |
public void setAreaOfInterest(Rectangle pixelWindow, int bufWidth, int bufHeight); |
|
60 |
|
|
61 |
public void setAreaOfInterest(Extent boundingBox); |
|
62 |
|
|
63 |
public void setAreaOfInterest(Extent boundingBox, int bufWidth, int bufHeight); |
|
64 |
|
|
65 |
public void setAreaOfInterest(Extent requestBoundingBox, int bufWidth, int bufHeight, TileListener listener); |
|
66 |
|
|
67 |
public void setTileParameters(int level, int tileCol, int tileRow); |
|
68 |
|
|
40 | 69 |
/** |
41 |
* Sets the frame width. This parameter is take into |
|
42 |
* account only when the request is tiled and this characteristic is |
|
43 |
* supported. |
|
44 |
* @param n |
|
70 |
* Parameters to make a tile request. |
|
71 |
* @param level |
|
72 |
* Resolution level |
|
73 |
* @param tileCol |
|
74 |
* Tile column in the matrix of its level |
|
75 |
* @param tileRow |
|
76 |
* Tile row in the matrix of its level |
|
77 |
* @param extent |
|
78 |
* Bounding box of the requested tile |
|
79 |
* @param cacheStruct |
|
80 |
* Cache structure force by the client |
|
81 |
* @deprecated |
|
45 | 82 |
*/ |
46 |
public void setFrameWidth(int n);
|
|
83 |
public void setTileParameters(int level, int tileCol, int tileRow, Extent extent, CacheStruct cacheStruct);
|
|
47 | 84 |
|
48 | 85 |
/** |
49 | 86 |
* Sets the number of the alpha band. This parameter is take into |
... | ... | |
138 | 175 |
* |
139 | 176 |
* @return true si el supersampleo en la carga del buffer est? activado y false si no lo est?. |
140 | 177 |
*/ |
141 |
public boolean isSupersamplingLoadingBuffer();
|
|
178 |
public boolean isSupersamplingOptionActive();
|
|
142 | 179 |
|
143 | 180 |
/** |
144 | 181 |
* Returns true if the buffer is not writable |
... | ... | |
175 | 212 |
* @param supersamplingLoadingBuffer true o false para activar o desactivar el supersampling en la |
176 | 213 |
* carga del buffer. |
177 | 214 |
*/ |
178 |
public void setSupersamplingLoadingBuffer(boolean supersamplingLoadingBuffer);
|
|
215 |
public void setSupersamplingOption(boolean supersamplingLoadingBuffer);
|
|
179 | 216 |
|
180 | 217 |
/** |
181 |
* Asigna el ?rea de interes en coordenadas del mundo real. |
|
182 |
* Si las coordenadas exceden del tama?o de la imagen estas coordenadas son ajustadas el extent. |
|
183 |
* @param x Coordenada X, esquina superior izquierda |
|
184 |
* @param y Coordenada Y, esquina superior izquierda |
|
185 |
* @param w Ancho del ?rea |
|
186 |
* @param h Alto del ?rea |
|
218 |
* Sets the task status |
|
219 |
* @param taskStatus |
|
187 | 220 |
*/ |
188 |
public void setAreaOfInterest(double x, double y, double w, double h);
|
|
221 |
public void setTaskStatus(TaskStatus taskStatus);
|
|
189 | 222 |
|
190 | 223 |
/** |
191 |
* Asigna el ?rea de interes en coordenadas del mundo real. Si las coordenadas exceden del tama?o de la imagen |
|
192 |
* estas coordenadas son ajustadas el extent. Si la petici?n es tileada se har? una llamada al listener cada vez |
|
193 |
* que se reciba un tile. |
|
194 |
* @param x Coordenada X, esquina superior izquierda |
|
195 |
* @param y Coordenada Y, esquina superior izquierda |
|
196 |
* @param w Ancho del ?rea |
|
197 |
* @param h Alto del ?rea |
|
198 |
* @param bufWidth Ancho del buffer |
|
199 |
* @param bufHeight Alto del buffer |
|
200 |
* @param listener Este listener es usado para recibir tiles. Cada vez que se recibe uno se har? una llamada. |
|
201 |
* @return En caso de que el buffer sea mayor que el tama?o seleccionado de raster se produce supersampleo. La funci?n devuelve |
|
202 |
* un array de dos elementos que representan el desplazamiento en pixels de X e Y de la esquina superior izquierda. |
|
224 |
* Giving a world coordinates, a buffer size and a original raster size. If the |
|
225 |
* buffer is bigger than the window requested in the source raster (supersampling), |
|
226 |
* then it means that each pixel of the raster will be written several times in |
|
227 |
* the destination buffer. |
|
228 |
* |
|
229 |
* This function calculates the shift in pixels en X and Y coordinate that |
|
230 |
* correspond with the first pixel, due to this pixel won't be drawn entirely. |
|
231 |
* |
|
232 |
* Dado unas coordenadas reales, un tama?o de buffer y un tama?o de raster. |
|
233 |
* Si el buffer es de mayor tama?o que el raster (supersampleo) quiere decir que |
|
234 |
* por cada pixel de buffer se repiten varios del raster. Esta funci?n calcula el |
|
235 |
* n?mero de pixels de desplazamiento en X e Y que corresponden al primer pixel del |
|
236 |
* buffer en la esquina superior izquierda. Esto es necesario porque la coordenada |
|
237 |
* solicitada es real y puede no caer sobre un pixel completo. Este calculo es |
|
238 |
* util cuando un cliente quiere supersamplear sobre un buffer y que no se lo haga |
|
239 |
* el driver autom?ticamente. |
|
203 | 240 |
*/ |
204 |
public void setAreaOfInterest(Extent bbox, int bufWidth, int bufHeight, TileListener listener); |
|
205 |
|
|
206 |
/** |
|
207 |
* Asigna el ?rea de interes en coordenadas del mundo real. |
|
208 |
* Si las coordenadas exceden del tama?o de la imagen estas coordenadas son ajustadas el extent. |
|
209 |
* Este es el m?todo que se gasta para dibujado. Aunque se ajusten las coordenadas reales el tama?o de buffer ser |
|
210 |
* respeta. Si el supersamplig est? desactivado entonces cuando el zoom es mayor que 1:1 modifica el tama?o de buffer |
|
211 |
* devolviendo un pixel buffer en un pixel de imagen. El buffer resultante ser? menor que el pedido. Esto es as? porque |
|
212 |
* hay proveedores que no supersamplean y porque el dibujado se encarga de supersamplear. |
|
213 |
* @param x Coordenada X, esquina superior izquierda |
|
214 |
* @param y Coordenada Y, esquina superior izquierda |
|
215 |
* @param w Ancho del ?rea |
|
216 |
* @param h Alto del ?rea |
|
217 |
* @param bufWidth Ancho del buffer |
|
218 |
* @param bufHeight Alto del buffer |
|
219 |
* @return En caso de que el buffer sea mayor que el tama?o seleccionado de raster se produce supersampleo. La funci?n devuelve |
|
220 |
* un array de dos elementos que representan el desplazamiento en pixels de X e Y de la esquina superior izquierda. |
|
221 |
* @throws ArrayIndexOutOfBoundsException |
|
222 |
* @throws InvalidSetViewException |
|
223 |
*/ |
|
224 |
public void setAreaOfInterest(Extent bbox, int bufWidth, int bufHeight); |
|
225 |
|
|
226 |
/** |
|
227 |
* Sets the area of interest in real coordinates |
|
228 |
* @param bbox |
|
229 |
*/ |
|
230 |
public void setAreaOfInterest(Extent bbox); |
|
241 |
public double[] getStep(); |
|
231 | 242 |
|
232 | 243 |
/** |
233 |
* Asigna el ?rea de interes en coordenadas pixel. Si las coordenadas exceden del tama?o de la imagen |
|
234 |
* lanza una excepci?n. |
|
235 |
* @param x Coordenada X, esquina superior izquierda |
|
236 |
* @param y Coordenada Y, esquina superior izquierda |
|
237 |
* @param w Ancho del ?rea |
|
238 |
* @param h Alto del ?rea |
|
239 |
* @throws InvalidSetViewException |
|
240 |
* @throws ArrayIndexOutOfBoundsException |
|
244 |
* Force that the built of the buffer be ARGB. Be careful with the renderBands. It |
|
245 |
* will have four bands as maximum. |
|
241 | 246 |
*/ |
242 |
public void setAreaOfInterest(int x, int y, int w, int h);
|
|
247 |
public void forceARGBRequest();
|
|
243 | 248 |
|
244 | 249 |
/** |
245 |
* Asigna el ?rea de inter?s a toda la extensi?n del raster. |
|
250 |
* Force that the built of the buffer be RGB. Be careful with the renderBands. It |
|
251 |
* will have three bands as maximum. |
|
246 | 252 |
*/ |
247 |
public void setAreaOfInterest();
|
|
253 |
public void forceRGBRequest();
|
|
248 | 254 |
|
249 |
/** |
|
250 |
* Asigna el ?rea de interes en coordenadas pixel. Esta operaci?n cargar? un RasterBuffer con los datos solicitados por |
|
251 |
* lo que, si al acabar hacemos getRasterBuf obtendremos la matriz de datos. Si las coordenadas exceden del tama?o |
|
252 |
* de la imagen lanza una excepci?n. |
|
253 |
* @param x Coordenada X, esquina superior izquierda |
|
254 |
* @param y Coordenada Y, esquina superior izquierda |
|
255 |
* @param w Ancho del ?rea |
|
256 |
* @param h Alto del ?rea |
|
257 |
* @param bufWidth Ancho del buffer |
|
258 |
* @param bufHeight Alto del buffer |
|
259 |
* @throws ArrayIndexOutOfBoundsException |
|
260 |
*/ |
|
261 |
public void setAreaOfInterest(int x, int y, int w, int h, int bufWidth, int bufHeight); |
|
255 |
public boolean isforcingRGBRequest(); |
|
262 | 256 |
|
257 |
public boolean isforcingARGBRequest(); |
|
258 |
|
|
263 | 259 |
/** |
264 |
* Parameters to make a tile request. |
|
265 |
* @param level |
|
266 |
* Resolution level |
|
267 |
* @param tileCol |
|
268 |
* Tile column in the matrix of its level |
|
269 |
* @param tileRow |
|
270 |
* Tile row in the matrix of its level |
|
271 |
* @param extent |
|
272 |
* Bounding box of the requested tile |
|
273 |
* @param cacheStruct |
|
274 |
* Cache structure force by the client |
|
260 |
* Buffer loaded by the provider. This buffer is created by the <code>RasterQuery</code> |
|
261 |
* but in some cases can be useful to pass the buffer already created by parameter. |
|
262 |
* In any case, is advisable not to do it. |
|
263 |
* @return |
|
275 | 264 |
*/ |
276 |
public void setTileParameters(int level, int tileCol, int tileRow, Extent extent, CacheStruct cacheStruct);
|
|
277 |
|
|
265 |
public void setBufferForProviders(Buffer buffer) throws QueryException;
|
|
266 |
|
|
278 | 267 |
/** |
279 |
* Sets the task status
|
|
280 |
* @param taskStatus
|
|
268 |
* Clones this RasterQuery
|
|
269 |
* @return
|
|
281 | 270 |
*/ |
282 |
public void setTaskStatus(TaskStatus taskStatus);
|
|
271 |
public RasterQuery clone();
|
|
283 | 272 |
|
284 | 273 |
} |
Also available in: Unified diff