Revision 27361 trunk/libraries/libRaster/src/org/gvsig/raster/grid/roi/ROI.java
ROI.java | ||
---|---|---|
117 | 117 |
} |
118 | 118 |
|
119 | 119 |
public double getAspect(int x, int y) |
120 |
throws GridException { |
|
120 |
throws GridException, InterruptedException {
|
|
121 | 121 |
if (isInGrid(xOffset+x, yOffset+y)) |
122 | 122 |
return grid.getAspect(x, y); |
123 | 123 |
else return getNoDataValue(); |
... | ... | |
135 | 135 |
* @param y Posici?n Y en coordenadas pixel del ROI |
136 | 136 |
* @throws RasterBufferInvalidAccessException |
137 | 137 |
* @return Valor byte |
138 |
* @throws InterruptedException |
|
138 | 139 |
*/ |
139 | 140 |
public byte getCellValueAsByte(int x, int y) |
140 |
throws GridException { |
|
141 |
throws GridException, InterruptedException {
|
|
141 | 142 |
if (isInGrid(xOffset+x, yOffset+y)) |
142 | 143 |
return grid.getCellValueAsByte(xOffset+x, yOffset+y); |
143 | 144 |
else |
... | ... | |
152 | 153 |
* @param y Posici?n Y en coordenadas pixel del ROI |
153 | 154 |
* @throws RasterBufferInvalidAccessException |
154 | 155 |
* @return Valor double |
156 |
* @throws InterruptedException |
|
155 | 157 |
*/ |
156 | 158 |
public double getCellValueAsDouble(int x, int y) |
157 |
throws GridException { |
|
159 |
throws GridException, InterruptedException {
|
|
158 | 160 |
if (isInGrid(xOffset+x, yOffset+y)) |
159 | 161 |
return grid.getCellValueAsDouble(xOffset+x, yOffset+y); |
160 | 162 |
else |
... | ... | |
169 | 171 |
* @param y Posici?n Y en coordenadas pixel del ROI |
170 | 172 |
* @throws RasterBufferInvalidAccessException |
171 | 173 |
* @return Valor Float |
174 |
* @throws InterruptedException |
|
172 | 175 |
*/ |
173 | 176 |
public float getCellValueAsFloat(int x, int y) |
174 |
throws GridException { |
|
177 |
throws GridException, InterruptedException {
|
|
175 | 178 |
if (isInGrid(xOffset+x, yOffset+y)) |
176 | 179 |
return grid.getCellValueAsFloat(xOffset+x, yOffset+y); |
177 | 180 |
else |
... | ... | |
186 | 189 |
* @param y Posici?n Y en coordenadas pixel del ROI |
187 | 190 |
* @throws RasterBufferInvalidAccessException |
188 | 191 |
* @return Valor int |
192 |
* @throws InterruptedException |
|
189 | 193 |
*/ |
190 | 194 |
public int getCellValueAsInt(int x, int y) |
191 |
throws GridException { |
|
195 |
throws GridException, InterruptedException {
|
|
192 | 196 |
if (isInGrid(xOffset+x, yOffset+y)) |
193 | 197 |
return grid.getCellValueAsInt(xOffset+x, yOffset+y); |
194 | 198 |
else |
... | ... | |
203 | 207 |
* @param y Posici?n Y en coordenadas pixel del ROI |
204 | 208 |
* @throws RasterBufferInvalidAccessException |
205 | 209 |
* @return Valor short |
210 |
* @throws InterruptedException |
|
206 | 211 |
*/ |
207 | 212 |
public short getCellValueAsShort(int x, int y) |
208 |
throws GridException { |
|
213 |
throws GridException, InterruptedException {
|
|
209 | 214 |
if (isInGrid(xOffset+x, yOffset+y)) |
210 | 215 |
return grid.getCellValueAsShort(xOffset+x, yOffset+y); |
211 | 216 |
else |
212 | 217 |
return (short) grid.getNoDataValue(); |
213 | 218 |
} |
214 | 219 |
|
215 |
public int getDirToNextDownslopeCell(int x, int y) throws GridException { |
|
220 |
public int getDirToNextDownslopeCell(int x, int y) throws GridException, InterruptedException {
|
|
216 | 221 |
return getDirToNextDownslopeCell(x, y, true); |
217 | 222 |
} |
218 | 223 |
|
219 | 224 |
public int getDirToNextDownslopeCell(int x, int y,boolean bForceDirToNoDataCell) |
220 |
throws GridException { |
|
225 |
throws GridException, InterruptedException {
|
|
221 | 226 |
if (isInGrid(xOffset+x, yOffset+y)) |
222 | 227 |
return grid.getDirToNextDownslopeCell(x, y, bForceDirToNoDataCell); |
223 | 228 |
else |
... | ... | |
246 | 251 |
*/ |
247 | 252 |
public int getValues() throws GridException { |
248 | 253 |
if (!statistic.isStatisticsCalculated()) |
249 |
statistic.calculateStatistics(); |
|
254 |
try { |
|
255 |
statistic.calculateStatistics(); |
|
256 |
} catch (InterruptedException e) { |
|
257 |
return 0; |
|
258 |
} |
|
250 | 259 |
return statistic.getValues(); |
251 | 260 |
} |
252 | 261 |
|
253 | 262 |
public double getMaxValue() throws GridException { |
254 | 263 |
if (!statistic.isStatisticsCalculated()) |
255 |
statistic.calculateStatistics(); |
|
264 |
try { |
|
265 |
statistic.calculateStatistics(); |
|
266 |
} catch (InterruptedException e) { |
|
267 |
return 0; |
|
268 |
} |
|
256 | 269 |
return statistic.getMax(); |
257 | 270 |
} |
258 | 271 |
|
259 | 272 |
public double getMeanValue() throws GridException { |
260 | 273 |
if (!statistic.isStatisticsCalculated()) |
261 |
statistic.calculateStatistics(); |
|
274 |
try { |
|
275 |
statistic.calculateStatistics(); |
|
276 |
} catch (InterruptedException e) { |
|
277 |
return 0; |
|
278 |
} |
|
262 | 279 |
return statistic.getMean(); |
263 | 280 |
} |
264 | 281 |
|
265 | 282 |
public double getMinValue() throws GridException { |
266 | 283 |
if (!statistic.isStatisticsCalculated()) |
267 |
statistic.calculateStatistics(); |
|
284 |
try { |
|
285 |
statistic.calculateStatistics(); |
|
286 |
} catch (InterruptedException e) { |
|
287 |
return 0; |
|
288 |
} |
|
268 | 289 |
return statistic.getMin(); |
269 | 290 |
} |
270 | 291 |
|
... | ... | |
274 | 295 |
*/ |
275 | 296 |
public double[][] getVarCovMatrix() throws GridException { |
276 | 297 |
if(!statistic.isAdvancedStatisticsCalculated()) |
277 |
statistic.calculateAdvancedStatistic(); |
|
298 |
try { |
|
299 |
statistic.calculateAdvancedStatistic(); |
|
300 |
} catch (InterruptedException e) { |
|
301 |
return null; |
|
302 |
} |
|
278 | 303 |
return statistic.getVarianceCovarianceMatrix(); |
279 | 304 |
} |
280 | 305 |
|
... | ... | |
291 | 316 |
return grid.getNoDataValue(); |
292 | 317 |
} |
293 | 318 |
|
294 |
public double getSlope(int x, int y) throws GridException { |
|
319 |
public double getSlope(int x, int y) throws GridException, InterruptedException {
|
|
295 | 320 |
if (isInGrid(xOffset+x, yOffset+y)) |
296 | 321 |
return grid.getSlope(x, y); |
297 | 322 |
else |
298 | 323 |
return getNoDataValue(); |
299 | 324 |
} |
300 | 325 |
|
301 |
public GridCell[] getSortedArrayOfCells() throws GridException { |
|
326 |
public GridCell[] getSortedArrayOfCells() throws GridException, InterruptedException {
|
|
302 | 327 |
int i; |
303 | 328 |
int iX,iY; |
304 | 329 |
int iNX = getNX(); |
... | ... | |
329 | 354 |
|
330 | 355 |
public double getVariance() throws GridException { |
331 | 356 |
if (!statistic.isStatisticsCalculated()) |
332 |
statistic.calculateStatistics(); |
|
357 |
try { |
|
358 |
statistic.calculateStatistics(); |
|
359 |
} catch (InterruptedException e) { |
|
360 |
return 0; |
|
361 |
} |
|
333 | 362 |
return statistic.getVariance(); |
334 | 363 |
} |
335 | 364 |
|
Also available in: Unified diff