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 @ 1136

History | View | Annotate | Download (10.9 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.TaskStatus;
32

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

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

    
161
        /**
162
         * Activa o desactiva el supersampling en la carga del buffer.
163
         * <P>
164
         * Si este flag es false
165
         * y pasamos un buffer de tama?o mayor que el n?mero de pixels del ?rea requerida en la
166
         * llamada setAreaOfInterest entonces se ajustar? este buffer al n?mero de pixeles contenidos
167
         * en el ?rea.
168
         * </P>
169
         * <P>
170
         * Por ejemplo, si solicitamos un ?rea de 5x4 pixels de un raster y pedimos que nos los grabe
171
         * en un buffer de 500x400, si esta variable es false el buffer lo generar? de 5x4. Si esta
172
         * variable es true el buffer lo generar? de 500x400.
173
         * </P>
174
         *
175
         * @param supersamplingLoadingBuffer true o false para activar o desactivar el supersampling en la
176
         * carga del buffer.
177
         */
178
        public void setSupersamplingLoadingBuffer(boolean supersamplingLoadingBuffer);
179
        
180
        /**
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
187
         */
188
        public void setAreaOfInterest(double x, double y, double w, double h);
189
        
190
        /**
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.
203
         */
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);
231

    
232
        /**
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
241
         */
242
        public void setAreaOfInterest(int x, int y, int w, int h);
243
        
244
        /**
245
         * Asigna el ?rea de inter?s a toda la extensi?n del raster.
246
         */
247
        public void setAreaOfInterest();
248
        
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);
262
        
263
        /**
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
275
         */
276
        public void setTileParameters(int level, int tileCol, int tileRow, Extent extent, CacheStruct cacheStruct);
277
        
278
        /**
279
         * Sets the task status
280
         * @param taskStatus
281
         */
282
        public void setTaskStatus(TaskStatus taskStatus);
283
        
284
}