Statistics
| Revision:

gvsig-raster / 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 @ 1057

History | View | Annotate | Download (11.1 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.fmap.dal.coverage.store;
23

    
24
import org.gvsig.fmap.dal.DataQuery;
25
import org.gvsig.fmap.dal.coverage.datastruct.Extent;
26
import org.gvsig.fmap.dal.coverage.datastruct.NoData;
27
import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
28
import org.gvsig.raster.cache.tile.provider.CacheStruct;
29
import org.gvsig.raster.cache.tile.provider.TileListener;
30
import org.gvsig.timesupport.Time;
31
import org.gvsig.tools.task.Cancellable;
32
import org.gvsig.tools.task.TaskStatus;
33

    
34
/**
35
 * Interfaz que contiene las operaciones que debe soportar la carga de datos
36
 * raster en un buffer.
37
 * @author Nacho Brodin (nachobrodin@gmail.com)
38
 */
39
public interface RasterQuery extends DataQuery {
40
        
41
        /**
42
         * Sets the frame width. This parameter is take into 
43
         * account only when the request is tiled and this characteristic is
44
         * supported.
45
         * @param n
46
         */
47
        public void setFrameWidth(int n);
48
        
49
        /**
50
         * Sets the number of the alpha band. This parameter is take into 
51
         * account only when the request is made using TileListener. In this case
52
         * the parameter transparencyBuffer in nextBuffer method will have the right
53
         * data.
54
         * @param bandNumber
55
         */
56
        public void setAlphaBand(int bandNumber);
57
        
58
        /**
59
         * The user can told if the buffer will be stored or not in the RasterDatasource.
60
         * @param store
61
         */
62
        public void storeLastBuffer(boolean store);
63
        
64
        /**
65
         * Asigna el flag que ajusta el extent de la petici?n al del raster. Si est? a
66
         * true en caso de que el extent de la petici?n sea mayor lo ajustar? a los limites
67
         * de este. Si est? a false no lo ajustar? rellenando los valores con NoData
68
         * @param adjustToExtent true para ajustar y false si no queremos que lo haga. Por defecto
69
         * estar? a true.
70
         */
71
        public void setAdjustToExtent(boolean adjustToExtent);
72
        
73
        /**
74
         * Obtiene el flag que ajusta el extent de la petici?n al del raster. Si est? a
75
         * true en caso de que el extent de la petici?n sea mayor lo ajustar? a los limites
76
         * de este. Si est? a false no lo ajustar? rellenando los valores con NoData. Por defecto
77
         * estar? a true.
78
         * @return true si ajusta y false si no lo hace
79
         */
80
        public boolean isAdjustToExtent();
81
        
82
        /**
83
         * Set the list of bands to write in a buffer when the call query be executed. 
84
         * Each position in the array represents a buffer band and the number inside 
85
         * of this position is the image band read which be write in the buffer 
86
         * @param drawableBands        Array with the list of bands to write
87
         */
88
        public void setDrawableBands(int[] drawableBands);
89
        
90
        /**
91
         * Gets a buffer of data with the same number of bands and the same order that
92
         * the original raster
93
         */
94
        public void setAllDrawableBands();
95
        
96
        /**
97
         * Gets the list of bands to write in a buffer when the call query be executed. 
98
         * Each position in the array represents a buffer band and the number inside 
99
         * of this position is the image band read which be write in the buffer 
100
         * @return Array with the list of bands
101
         */
102
        public int[] getDrawableBands();
103
        
104
        /**
105
         * Asigna el flag que dice si la carga del siguiente buffer es de solo lectura o lectura/escritura.
106
         * La asignaci?n del flag de solo lectura a true debe hacerse para cada consulta.
107
         * @param readOnly true si la siguiente carga de buffer se hace de solo lectura y false si es de lectura/escritura
108
         */
109
        public void setReadOnly(boolean readOnly);
110
        
111
        /**
112
         * Asigna el flag que dice si la carga del siguiente buffer es en memoria
113
         * @param memory true si la siguiente carga de buffer se hace en memoria y false se deja decidir al dataset 
114
         * el tipo de buffer
115
         */
116
        public void setMemoryBuffer(boolean readOnly);
117
        
118
        /**
119
         * Asigna el valor noData con el que se rellenan las celdas cuando se hace una petici?n
120
         * en la que no se quiere que se ajuste al ?rea del raster. Por defecto noData tendr? el valor
121
         * que aparece en IBuffer.
122
         * @param noData
123
         */
124
        public void setNoDataToFill(NoData noData);
125
        
126
        /**
127
         * Consulta el flag de supersampleo en la carga del buffer.
128
         * <P>
129
         * Si este flag es false
130
         * y pasamos un buffer de tama?o mayor que el n?mero de pixels del ?rea requerida en la
131
         * llamada setAreaOfInterest entonces se ajustar? este buffer al n?mero de pixeles contenidos
132
         * en el ?rea.
133
         * </P>
134
         * <P>
135
         * Por ejemplo, si solicitamos un ?rea de 5x4 pixels de un raster y pedimos que nos los grabe
136
         * en un buffer de 500x400, si esta variable es false el buffer lo generar? de 5x4. Si esta
137
         * variable es true el buffer lo generar? de 500x400.
138
         * </P>
139
         *
140
         * @return true si el supersampleo en la carga del buffer est? activado y false si no lo est?.
141
         */
142
        public boolean isSupersamplingLoadingBuffer();
143
        
144
        /**
145
         * Returns true if the buffer is not writable
146
         * @return
147
         */
148
        public boolean isReadOnly();
149
        
150
        /**
151
         * Gets the time information of the viewport requested
152
         * @return
153
         */
154
        public Time getTime();
155

    
156
        /**
157
         * Sets the time information of the viewport requested
158
         * @return
159
         */
160
        public void setTime(Time time);
161

    
162
        /**
163
         * Activa o desactiva el supersampling en la carga del buffer.
164
         * <P>
165
         * Si este flag es false
166
         * y pasamos un buffer de tama?o mayor que el n?mero de pixels del ?rea requerida en la
167
         * llamada setAreaOfInterest entonces se ajustar? este buffer al n?mero de pixeles contenidos
168
         * en el ?rea.
169
         * </P>
170
         * <P>
171
         * Por ejemplo, si solicitamos un ?rea de 5x4 pixels de un raster y pedimos que nos los grabe
172
         * en un buffer de 500x400, si esta variable es false el buffer lo generar? de 5x4. Si esta
173
         * variable es true el buffer lo generar? de 500x400.
174
         * </P>
175
         *
176
         * @param supersamplingLoadingBuffer true o false para activar o desactivar el supersampling en la
177
         * carga del buffer.
178
         */
179
        public void setSupersamplingLoadingBuffer(boolean supersamplingLoadingBuffer);
180
        
181
        /**
182
         * Asigna el ?rea de interes en coordenadas del mundo real. 
183
         * Si las coordenadas exceden del tama?o de la imagen estas coordenadas son ajustadas el extent.
184
         * @param x Coordenada X, esquina superior izquierda
185
         * @param y Coordenada Y, esquina superior izquierda
186
         * @param w Ancho del ?rea
187
         * @param h Alto del ?rea
188
         */
189
        public void setAreaOfInterest(double x, double y, double w, double h);
190
        
191
        /**
192
         * Asigna el ?rea de interes en coordenadas del mundo real. Si las coordenadas exceden del tama?o de la imagen
193
         * estas coordenadas son ajustadas el extent. Si la petici?n es tileada se har? una llamada al listener cada vez
194
         * que se reciba un tile.
195
         * @param x Coordenada X, esquina superior izquierda
196
         * @param y Coordenada Y, esquina superior izquierda
197
         * @param w Ancho del ?rea
198
         * @param h Alto del ?rea
199
         * @param bufWidth Ancho del buffer
200
         * @param bufHeight Alto del buffer
201
         * @param listener Este listener es usado para recibir tiles. Cada vez que se recibe uno se har? una llamada.
202
         * @return En caso de que el buffer sea mayor que el tama?o seleccionado de raster se produce supersampleo. La funci?n devuelve
203
         * un array de dos elementos que representan el desplazamiento en pixels de X e Y de la esquina superior izquierda.
204
         */
205
        public void setAreaOfInterest(Extent bbox, int bufWidth, int bufHeight, TileListener listener);
206
        
207
        /**
208
         * Asigna el ?rea de interes en coordenadas del mundo real. 
209
         * Si las coordenadas exceden del tama?o de la imagen estas coordenadas son ajustadas el extent.
210
         * Este es el m?todo que se gasta para dibujado. Aunque se ajusten las coordenadas reales el tama?o de buffer ser
211
         * respeta. Si el supersamplig est? desactivado entonces cuando el zoom es mayor que 1:1 modifica el tama?o de buffer
212
         * devolviendo un pixel buffer en un pixel de imagen. El buffer resultante ser? menor que el pedido. Esto es as? porque
213
         * hay proveedores que no supersamplean y porque el dibujado se encarga de supersamplear.  
214
         * @param x Coordenada X, esquina superior izquierda
215
         * @param y Coordenada Y, esquina superior izquierda
216
         * @param w Ancho del ?rea
217
         * @param h Alto del ?rea
218
         * @param bufWidth Ancho del buffer
219
         * @param bufHeight Alto del buffer
220
         * @return En caso de que el buffer sea mayor que el tama?o seleccionado de raster se produce supersampleo. La funci?n devuelve
221
         * un array de dos elementos que representan el desplazamiento en pixels de X e Y de la esquina superior izquierda.
222
         * @throws ArrayIndexOutOfBoundsException
223
         * @throws InvalidSetViewException 
224
         */
225
        public void setAreaOfInterest(Extent bbox, int bufWidth, int bufHeight);
226
        
227
        /**
228
         * Sets the area of interest in real coordinates
229
         * @param bbox
230
         */
231
        public void setAreaOfInterest(Extent bbox);
232

    
233
        /**
234
         * Asigna el ?rea de interes en coordenadas pixel. Si las coordenadas exceden del tama?o de la imagen
235
         * lanza una excepci?n.
236
         * @param x Coordenada X, esquina superior izquierda
237
         * @param y Coordenada Y, esquina superior izquierda
238
         * @param w Ancho del ?rea
239
         * @param h Alto del ?rea
240
         * @throws InvalidSetViewException  
241
         * @throws ArrayIndexOutOfBoundsException
242
         */
243
        public void setAreaOfInterest(int x, int y, int w, int h);
244
        
245
        /**
246
         * Asigna el ?rea de inter?s a toda la extensi?n del raster.
247
         */
248
        public void setAreaOfInterest();
249
        
250
        /**
251
         * Asigna el ?rea de interes en coordenadas pixel. Esta operaci?n cargar? un RasterBuffer con los datos solicitados por
252
         * lo que, si al acabar hacemos getRasterBuf obtendremos la matriz de datos. Si las coordenadas exceden del tama?o
253
         * de la imagen lanza una excepci?n.
254
         * @param x Coordenada X, esquina superior izquierda
255
         * @param y Coordenada Y, esquina superior izquierda
256
         * @param w Ancho del ?rea
257
         * @param h Alto del ?rea
258
         * @param bufWidth Ancho del buffer
259
         * @param bufHeight Alto del buffer
260
         * @throws ArrayIndexOutOfBoundsException
261
         */
262
        public void setAreaOfInterest(int x, int y, int w, int h, int bufWidth, int bufHeight);
263
        
264
        /**
265
         * Parameters to make a tile request.
266
         * @param level
267
         *        Resolution level 
268
         * @param tileCol 
269
         *        Tile column in the matrix of its level
270
         * @param tileRow
271
         *        Tile row in the matrix of its level
272
         * @param extent
273
         *        Bounding box of the requested tile
274
         * @param cacheStruct
275
         *        Cache structure force by the client
276
         */
277
        public void setTileParameters(int level, int tileCol, int tileRow, Extent extent, CacheStruct cacheStruct);
278
        
279
        /**
280
         * Sets the task status
281
         * @param taskStatus
282
         */
283
        public void setTaskStatus(TaskStatus taskStatus);
284
        
285
        /**
286
         * Cancelaci?n temporal solo para tiles hasta que est? disponible TaskStatus
287
         * @deprecated
288
         */
289
        public void setCancel(Cancellable cancel);
290
}