svn-gvsig-desktop / trunk / libraries / libRaster / src / org / gvsig / raster / grid / IQueryableGrid.java @ 28321
History | View | Annotate | Download (6.37 KB)
1 | 10740 | nacho | /* 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 | 11076 | nacho | import org.gvsig.raster.buffer.RasterBufferInvalidAccessException; |
22 | |||
23 | 10740 | nacho | /**
|
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 | 16590 | nbrodin | public double getMinValue() throws GridException; |
34 | 10740 | nacho | |
35 | /**
|
||
36 | * Obtiene el valor m?ximo del grid
|
||
37 | * @return Valor m?ximo
|
||
38 | */
|
||
39 | 16590 | nbrodin | public double getMaxValue() throws GridException; |
40 | 10740 | nacho | |
41 | /**
|
||
42 | * Obtiene el valor m?dio del grid
|
||
43 | * @return Valor medio
|
||
44 | */
|
||
45 | 16590 | nbrodin | public double getMeanValue() throws GridException; |
46 | 10740 | nacho | |
47 | /**
|
||
48 | * Obtiene la varianza
|
||
49 | * @return Varianza
|
||
50 | */
|
||
51 | 16590 | nbrodin | public double getVariance() throws GridException; |
52 | 10740 | nacho | |
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 | 27361 | nbrodin | public byte getCellValueAsByte(int x, int y)throws GridException, InterruptedException ; |
63 | 10740 | nacho | |
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 | 27361 | nbrodin | * @throws InterruptedException
|
73 | 10740 | nacho | */
|
74 | 27361 | nbrodin | public short getCellValueAsShort(int x, int y)throws GridException, InterruptedException; |
75 | 10740 | nacho | |
76 | /**
|
||
77 | * Obtiene el valor de una celda de tipo int. Si el punto excede los l?mites
|
||
78 | * del grid devuelve un valor NoData. La excepci?n ser? lanzada si intentamos
|
||
79 | * acceder a un tipo de dato erroneo.
|
||
80 | * @param x Posici?n X a recuperar
|
||
81 | * @param y Posici?n Y a recuperar
|
||
82 | * @throws RasterBufferInvalidAccessException
|
||
83 | * @return Valor int
|
||
84 | */
|
||
85 | 27361 | nbrodin | public int getCellValueAsInt(int x, int y)throws GridException, InterruptedException ; |
86 | 10740 | nacho | |
87 | /**
|
||
88 | * Obtiene el valor de una celda de tipo float. Si el punto excede los l?mites
|
||
89 | * del grid devuelve un valor NoData. La excepci?n ser? lanzada si intentamos
|
||
90 | * acceder a un tipo de dato erroneo.
|
||
91 | * @param x Posici?n X a recuperar
|
||
92 | * @param y Posici?n Y a recuperar
|
||
93 | * @throws RasterBufferInvalidAccessException
|
||
94 | * @return Valor float
|
||
95 | */
|
||
96 | 27361 | nbrodin | public float getCellValueAsFloat(int x, int y)throws GridException, InterruptedException ; |
97 | 10740 | nacho | |
98 | /**
|
||
99 | * Obtiene el valor de una celda de tipo double. Si el punto excede los l?mites
|
||
100 | * del grid devuelve un valor NoData. La excepci?n ser? lanzada si intentamos
|
||
101 | * acceder a un tipo de dato erroneo.
|
||
102 | * @param x Posici?n X a recuperar
|
||
103 | * @param y Posici?n Y a recuperar
|
||
104 | * @throws RasterBufferInvalidAccessException
|
||
105 | * @return Valor double
|
||
106 | */
|
||
107 | 27361 | nbrodin | public double getCellValueAsDouble(int x, int y)throws GridException, InterruptedException ; |
108 | 10740 | nacho | |
109 | /**
|
||
110 | * Asigna el m?todo de interpolaci?n. Si el lector no es interpolado se instanciar?
|
||
111 | * como interpolado sin necesidad de llamar a switchToInterpolationMethod. Los m?todos
|
||
112 | * de interpolaci?n soportados est?n definidos en la clase GridInterpolated como variables
|
||
113 | * est?ticas.
|
||
114 | *
|
||
115 | * @param iMethod
|
||
116 | */
|
||
117 | public void setInterpolationMethod(int iMethod); |
||
118 | |||
119 | /**
|
||
120 | * Consulta al grid si el valor pasado por par?metro coincide con el valor NoData del
|
||
121 | * buffer.
|
||
122 | * @param dValue valor para comparar con el NoData del buffer
|
||
123 | * @return true si el valor pasado es NoData y false si no lo es
|
||
124 | */
|
||
125 | public boolean isNoDataValue(double dValue); |
||
126 | |||
127 | /**
|
||
128 | * Obtiene la extensi?n de la ventana del raster accedida por el grid
|
||
129 | * @return Objeto GridExtent con la extensi?n.
|
||
130 | */
|
||
131 | public GridExtent getGridExtent();
|
||
132 | |||
133 | /**
|
||
134 | * Consulta si un punto est? dentro del grid o fuera de el
|
||
135 | * @param x Coordenada X del punto a consultar
|
||
136 | * @param y Coordenada Y del punto a consultar
|
||
137 | * @return true si el punto est? dentro del grid y false si est? fuera de ?l
|
||
138 | */
|
||
139 | public boolean isInGrid(int x, int y); |
||
140 | 18652 | nbrodin | |
141 | /**
|
||
142 | * Obtiene el ancho en p?xeles del grid
|
||
143 | * @return entero que representa el ancho en p?xeles
|
||
144 | */
|
||
145 | public int getNX(); |
||
146 | 10740 | nacho | |
147 | 18652 | nbrodin | /**
|
148 | * Obtiene el alto en p?xeles del grid
|
||
149 | * @return entero que representa el alto en p?xeles
|
||
150 | */
|
||
151 | public int getNY(); |
||
152 | |||
153 | /**
|
||
154 | * Obtiene el ancho en p?xeles del dataset completo
|
||
155 | * @return entero que representa el ancho en p?xeles del dataset completo
|
||
156 | */
|
||
157 | 10740 | nacho | public int getLayerNX(); |
158 | |||
159 | 18652 | nbrodin | /**
|
160 | * Obtiene el alto en p?xeles del dataset completo
|
||
161 | * @return entero que representa el alto en p?xeles del dataset completo
|
||
162 | */
|
||
163 | 10740 | nacho | public int getLayerNY(); |
164 | |||
165 | 18652 | nbrodin | /**
|
166 | * Tama?o de celda
|
||
167 | * @return
|
||
168 | */
|
||
169 | 10740 | nacho | public double getCellSize(); |
170 | |||
171 | 18652 | nbrodin | /**
|
172 | * Valor NODATa asociado al grid
|
||
173 | * @return
|
||
174 | */
|
||
175 | 10740 | nacho | public double getNoDataValue(); |
176 | |||
177 | 18652 | nbrodin | /**
|
178 | * Obtiene la pendiente de un ?rea de 3x3 p?xeles que tiene como
|
||
179 | * centro las coordenadas que se le indican
|
||
180 | * @param x Coordenada pixel X
|
||
181 | * @param y Coordenada pixel Y
|
||
182 | * @return
|
||
183 | * @throws GridException
|
||
184 | 27361 | nbrodin | * @throws InterruptedException
|
185 | 18652 | nbrodin | */
|
186 | 27361 | nbrodin | public double getSlope(int x, int y)throws GridException, InterruptedException; |
187 | 10740 | nacho | |
188 | 27361 | nbrodin | public double getAspect(int x, int y)throws GridException, InterruptedException; |
189 | 10740 | nacho | |
190 | public double getDistToNeighborInDir(int iDir); |
||
191 | |||
192 | 27361 | nbrodin | public int getDirToNextDownslopeCell(int x, int y)throws GridException, InterruptedException; |
193 | 10740 | nacho | |
194 | 27361 | nbrodin | public int getDirToNextDownslopeCell(int x, int y, boolean bForceDirToNoDataCell)throws GridException, InterruptedException; |
195 | 10740 | nacho | |
196 | 27361 | nbrodin | public GridCell[] getSortedArrayOfCells()throws GridException, InterruptedException; |
197 | 10740 | nacho | } |