Statistics
| Revision:

root / trunk / libraries / libRaster / src / org / gvsig / raster / grid / IQueryableGrid.java @ 11076

History | View | Annotate | Download (5.45 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2006 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19
package org.gvsig.raster.grid;
20

    
21
import java.util.Arrays;
22

    
23
import org.gvsig.raster.buffer.RasterBufferInvalidAccessException;
24

    
25
/**
26
 * Interfaz que deben implementar los grid en los que se puede consultar sus datos.
27
 * @author Nacho Brodin (nachobrodin@gmail.com)
28
 */
29
public interface IQueryableGrid {          
30

    
31
        /**
32
         * Obtiene el valor m?ximo del grid
33
         * @return Valor m?nimo
34
         */
35
        public double getMinValue();
36
        
37
        /**
38
         * Obtiene el valor m?ximo del grid
39
         * @return Valor m?ximo
40
         */
41
        public double getMaxValue();
42
        
43
        /**
44
         * Obtiene el valor m?dio del grid
45
         * @return Valor medio
46
         */
47
        public double getMeanValue();
48
        
49
        /**
50
         * Obtiene la varianza
51
         * @return Varianza
52
         */
53
        public double getVariance();
54
        
55
        /**
56
         * Obtiene el valor de una celda de tipo byte. Si el punto excede los l?mites
57
         * del grid devuelve un valor NoData. La excepci?n ser? lanzada si intentamos 
58
         * acceder a un tipo de dato erroneo.
59
         * @param x Posici?n X a recuperar
60
         * @param y Posici?n Y a recuperar
61
         * @throws RasterBufferInvalidAccessException
62
         * @return Valor byte
63
         */
64
        public byte getCellValueAsByte(int x, int y)throws RasterBufferInvalidAccessException;
65
        
66
        /**
67
         * Obtiene el valor de una celda de tipo short. Si el punto excede los l?mites
68
         * del grid devuelve un valor NoData. La excepci?n ser? lanzada si intentamos 
69
         * acceder a un tipo de dato erroneo.
70
         * @param x Posici?n X a recuperar
71
         * @param y Posici?n Y a recuperar
72
         * @throws RasterBufferInvalidAccessException
73
         * @return Valor short
74
         */
75
        public short getCellValueAsShort(int x, int y)throws RasterBufferInvalidAccessException;
76
        
77
        /**
78
         * Obtiene el valor de una celda de tipo int. Si el punto excede los l?mites
79
         * del grid devuelve un valor NoData. La excepci?n ser? lanzada si intentamos 
80
         * acceder a un tipo de dato erroneo.
81
         * @param x Posici?n X a recuperar
82
         * @param y Posici?n Y a recuperar
83
         * @throws RasterBufferInvalidAccessException
84
         * @return Valor int
85
         */
86
        public int getCellValueAsInt(int x, int y)throws RasterBufferInvalidAccessException;
87

    
88
        /**
89
         * Obtiene el valor de una celda de tipo float. Si el punto excede los l?mites
90
         * del grid devuelve un valor NoData. La excepci?n ser? lanzada si intentamos 
91
         * acceder a un tipo de dato erroneo.
92
         * @param x Posici?n X a recuperar
93
         * @param y Posici?n Y a recuperar
94
         * @throws RasterBufferInvalidAccessException
95
         * @return Valor float
96
         */
97
        public float getCellValueAsFloat(int x, int y)throws RasterBufferInvalidAccessException;
98
        
99
        /**
100
         * Obtiene el valor de una celda de tipo double. Si el punto excede los l?mites
101
         * del grid devuelve un valor NoData. La excepci?n ser? lanzada si intentamos 
102
         * acceder a un tipo de dato erroneo.
103
         * @param x Posici?n X a recuperar
104
         * @param y Posici?n Y a recuperar
105
         * @throws RasterBufferInvalidAccessException
106
         * @return Valor double
107
         */
108
        public double getCellValueAsDouble(int x, int y)throws RasterBufferInvalidAccessException;
109
        
110
        /**
111
         * Asigna el m?todo de interpolaci?n. Si el lector no es interpolado se instanciar? 
112
         * como interpolado sin necesidad de llamar a switchToInterpolationMethod. Los m?todos
113
         * de interpolaci?n soportados est?n definidos en la clase GridInterpolated como variables
114
         * est?ticas.
115
         * 
116
         * @param iMethod
117
         */
118
        public void setInterpolationMethod(int iMethod);
119
        
120
        /**
121
         * Consulta al grid si el valor pasado por par?metro coincide con el valor NoData del 
122
         * buffer. 
123
         * @param dValue valor para comparar con el NoData del buffer
124
         * @return true si el valor pasado es NoData y false si no lo es
125
         */
126
        public boolean isNoDataValue(double dValue);
127
        
128
        /**
129
         * Obtiene la extensi?n de la ventana del raster accedida por el grid 
130
         * @return Objeto GridExtent con la extensi?n.
131
         */
132
        public GridExtent getGridExtent();
133
        
134
        /**
135
         * Consulta si un punto est? dentro del grid o fuera de el
136
         * @param x Coordenada X del punto a consultar
137
         * @param y Coordenada Y del punto a consultar 
138
         * @return true si el punto est? dentro del grid y false si est? fuera de ?l
139
         */
140
        public boolean isInGrid(int x, int y);
141
        
142
        public int getLayerNX();
143
        
144
        public int getLayerNY();
145
        
146
        public int getNX();
147
        
148
        public int getNY();
149
        
150
        public double getCellSize();
151
        
152
        public double getNoDataValue();
153
        
154
        public double getSlope(int x, int y)throws RasterBufferInvalidAccessException;
155
                        
156
        public double getAspect(int x, int y)throws RasterBufferInvalidAccessException;
157
        
158
        public double getDistToNeighborInDir(int iDir);
159
        
160
        public int getDirToNextDownslopeCell(int x, int y)throws RasterBufferInvalidAccessException;
161
        
162
        public int getDirToNextDownslopeCell(int x, int y, boolean bForceDirToNoDataCell)throws RasterBufferInvalidAccessException;
163
        
164
        public GridCell[] getSortedArrayOfCells()throws RasterBufferInvalidAccessException;        
165
}