Statistics
| Revision:

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

History | View | Annotate | Download (5.42 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 org.gvsig.raster.buffer.RasterBufferInvalidAccessException;
22

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

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

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