gvsig-raster / org.gvsig.raster / trunk / org.gvsig.raster / org.gvsig.raster.lib / org.gvsig.raster.lib.impl / src / main / java / org / gvsig / raster / impl / store / DefaultTRasterStore.java @ 633
History | View | Annotate | Download (27.5 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.raster.impl.store; |
23 |
|
24 |
import java.awt.geom.AffineTransform; |
25 |
import java.awt.geom.Point2D; |
26 |
import java.util.ArrayList; |
27 |
|
28 |
import org.cresques.cts.IProjection; |
29 |
import org.gvsig.compat.net.ICancellable; |
30 |
import org.gvsig.fmap.dal.coverage.RasterLocator; |
31 |
import org.gvsig.fmap.dal.coverage.dataset.Buffer; |
32 |
import org.gvsig.fmap.dal.coverage.datastruct.BandList; |
33 |
import org.gvsig.fmap.dal.coverage.datastruct.Extent; |
34 |
import org.gvsig.fmap.dal.coverage.datastruct.SerialInfo; |
35 |
import org.gvsig.fmap.dal.coverage.exception.BandAccessException; |
36 |
import org.gvsig.fmap.dal.coverage.exception.CloneException; |
37 |
import org.gvsig.fmap.dal.coverage.exception.FileNotFoundInListException; |
38 |
import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException; |
39 |
import org.gvsig.fmap.dal.coverage.exception.HistogramException; |
40 |
import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException; |
41 |
import org.gvsig.fmap.dal.coverage.exception.InvalidSourceException; |
42 |
import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException; |
43 |
import org.gvsig.fmap.dal.coverage.exception.OperationNotSupportedException; |
44 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
45 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
46 |
import org.gvsig.fmap.dal.coverage.exception.RemoteServiceException; |
47 |
import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException; |
48 |
import org.gvsig.fmap.dal.coverage.exception.TimeException; |
49 |
import org.gvsig.fmap.dal.coverage.store.RasterDataStore; |
50 |
import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation; |
51 |
import org.gvsig.fmap.dal.coverage.store.props.ColorTable; |
52 |
import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer; |
53 |
import org.gvsig.fmap.dal.coverage.store.props.Metadata; |
54 |
import org.gvsig.fmap.dal.coverage.store.props.Statistics; |
55 |
import org.gvsig.fmap.dal.coverage.store.props.TimeSeries; |
56 |
import org.gvsig.fmap.dal.coverage.store.props.Transparency; |
57 |
import org.gvsig.fmap.dal.exception.CloseException; |
58 |
import org.gvsig.fmap.dal.raster.spi.CoverageStoreProvider; |
59 |
import org.gvsig.metadata.exceptions.MetadataException; |
60 |
import org.gvsig.raster.cache.tile.provider.TileListener; |
61 |
import org.gvsig.raster.impl.datastruct.DefaultSerialInfo; |
62 |
import org.gvsig.raster.impl.provider.DefaultTimeSerials; |
63 |
import org.gvsig.raster.impl.provider.RasterProvider; |
64 |
import org.gvsig.timesupport.Time; |
65 |
|
66 |
/**
|
67 |
* This class is composed by several DataStores.
|
68 |
* Each internal DataStore represents a moment in the time and each
|
69 |
* request should be thrown with temporary information.
|
70 |
*
|
71 |
* @version 29/08/2007
|
72 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
73 |
*/
|
74 |
public class DefaultTRasterStore extends AbstractRasterDataStore { |
75 |
private ArrayList<RasterDataStore> list = new ArrayList<RasterDataStore>(); |
76 |
//Controla el store seleccionado
|
77 |
private int selectedStore = 0; |
78 |
|
79 |
/**
|
80 |
* Constructor.
|
81 |
*/
|
82 |
public DefaultTRasterStore(RasterDataStore dataStore) throws TimeException { |
83 |
list.add(dataStore); |
84 |
try {
|
85 |
dataStore.getTimeSerials(); |
86 |
} catch (RmfSerializerException e) {
|
87 |
throw new TimeException(e.getMessage(), e); |
88 |
} |
89 |
} |
90 |
|
91 |
/*
|
92 |
* (non-Javadoc)
|
93 |
* @see org.gvsig.fmap.dal.coverage.store.TRasterStore#addDataStore(org.gvsig.fmap.dal.coverage.store.RasterDataStore)
|
94 |
*/
|
95 |
public void addTemporalDataStore(RasterDataStore store) { |
96 |
list.add(store); |
97 |
} |
98 |
|
99 |
/*
|
100 |
* (non-Javadoc)
|
101 |
* @see org.gvsig.fmap.dal.coverage.store.TRasterStore#setTime(org.gvsig.fmap.dal.coverage.datastruct.TimeInfo)
|
102 |
*/
|
103 |
public void setTime(Time time) throws TimeException { |
104 |
/*RasterDataStore store = list.get(selectedStore);
|
105 |
try {
|
106 |
DataStoreTimeSerials sInfo = (DataStoreTimeSerials)store.getTimeSerials();
|
107 |
DefaultSerialInfo tInfo1 = sInfo.getSerial(0);
|
108 |
DefaultSerialInfo tInfo2 = new DefaultSerialInfo(time, tInfo1.getDescription(), tInfo1.getSerialName());
|
109 |
//Si se ha encontrado una serie se mira si el tiempo seleccionado
|
110 |
//est? en el rango de la serie y si es as? se selecciona ese DataStore
|
111 |
if(tInfo1 != null && tInfo2 != null) {
|
112 |
if(tInfo1.isInRange(tInfo2)) {
|
113 |
selectedStore = i;
|
114 |
break;
|
115 |
}
|
116 |
}
|
117 |
} catch (RmfSerializerException e) {
|
118 |
throw new TimeException(e.getMessage(), e);
|
119 |
}*/
|
120 |
} |
121 |
|
122 |
/*
|
123 |
* (non-Javadoc)
|
124 |
* @see org.gvsig.fmap.dal.coverage.store.TRasterStore#setTime(org.gvsig.fmap.dal.coverage.datastruct.TimeInfo)
|
125 |
*/
|
126 |
public void setTime(SerialInfo time) throws TimeException { |
127 |
for (int i = 0; i < list.size(); i++) { |
128 |
RasterDataStore store = list.get(i); |
129 |
try {
|
130 |
DefaultSerialInfo tInfo = null;
|
131 |
DefaultTimeSerials sInfo = (DefaultTimeSerials)store.getTimeSerials(); |
132 |
//Busca la serie del mismo nombre q la de este TRasterStore
|
133 |
for (int j = 0; j < sInfo.getNumberOfSerials(); j++) { |
134 |
tInfo = sInfo.getSerial(j); |
135 |
if(tInfo.getSerialName().compareTo(getSerialName()) == 0) |
136 |
break;
|
137 |
tInfo = null;
|
138 |
} |
139 |
//Si se ha encontrado una serie se mira si el tiempo seleccionado
|
140 |
//est? en el rango de la serie y si es as? se selecciona ese DataStore
|
141 |
if(tInfo != null) { |
142 |
if(tInfo.isInRange(time)) {
|
143 |
selectedStore = i; |
144 |
break;
|
145 |
} |
146 |
} |
147 |
} catch (RmfSerializerException e) {
|
148 |
throw new TimeException(e.getMessage(), e); |
149 |
} |
150 |
} |
151 |
} |
152 |
|
153 |
/*
|
154 |
* (non-Javadoc)
|
155 |
* @see org.gvsig.fmap.dal.coverage.store.TRasterStore#selectNext()
|
156 |
*/
|
157 |
public void selectNext() { |
158 |
selectedStore ++; |
159 |
selectedStore = selectedStore >= list.size() ? 0 : selectedStore;
|
160 |
} |
161 |
|
162 |
/*
|
163 |
* (non-Javadoc)
|
164 |
* @see org.gvsig.fmap.dal.coverage.store.TRasterStore#selectPrev()
|
165 |
*/
|
166 |
public void selectPrev() { |
167 |
selectedStore --; |
168 |
selectedStore = selectedStore < 0 ? list.size() - 1 : selectedStore; |
169 |
} |
170 |
|
171 |
/*
|
172 |
* (non-Javadoc)
|
173 |
* @see org.gvsig.fmap.dal.coverage.store.TRasterStore#goTo(int)
|
174 |
*/
|
175 |
public void goTo(int position) { |
176 |
selectedStore = position; |
177 |
selectedStore = (selectedStore >= list.size()) ? list.size() - 1 :
|
178 |
((selectedStore < 0) ? 0: selectedStore); |
179 |
} |
180 |
|
181 |
/*
|
182 |
* (non-Javadoc)
|
183 |
* @see org.gvsig.fmap.dal.DataStore#getName()
|
184 |
*/
|
185 |
public String getName() { |
186 |
return list.get(selectedStore).getName();
|
187 |
} |
188 |
|
189 |
/*
|
190 |
* (non-Javadoc)
|
191 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#isTiled()
|
192 |
*/
|
193 |
public boolean isTiled() { |
194 |
return list.get(selectedStore).isTiled();
|
195 |
} |
196 |
|
197 |
/*
|
198 |
* (non-Javadoc)
|
199 |
* @see org.gvsig.raster.impl.dataset.QueryableRaster#getProviders()
|
200 |
*/
|
201 |
public ArrayList<RasterProvider> getProviders() { |
202 |
return ((QueryableRaster)list.get(selectedStore)).getProviders();
|
203 |
} |
204 |
|
205 |
/*
|
206 |
* (non-Javadoc)
|
207 |
* @see org.gvsig.raster.impl.dataset.QueryableRaster#getProvider(int)
|
208 |
*/
|
209 |
public RasterProvider getProvider(int i) { |
210 |
return ((QueryableRaster)list.get(selectedStore)).getProvider(i);
|
211 |
} |
212 |
|
213 |
/*
|
214 |
* (non-Javadoc)
|
215 |
* @see org.gvsig.raster.impl.dataset.QueryableRaster#getDrawableBands()
|
216 |
*/
|
217 |
public int[] getDrawableBands() { |
218 |
return getBands().getDrawableBands();
|
219 |
} |
220 |
|
221 |
/*
|
222 |
* (non-Javadoc)
|
223 |
* @see org.gvsig.raster.impl.dataset.QueryableRaster#calcSteps(double, double, double, double, double, double, int, int)
|
224 |
*/
|
225 |
public double[] calcSteps(double dWorldTLX, double dWorldTLY, double dWorldBRX, double dWorldBRY, double nWidth, double nHeight, int bufWidth, int bufHeight) { |
226 |
return ((QueryableRaster)list.get(selectedStore)).calcSteps(dWorldTLX, dWorldTLY, dWorldBRX, dWorldBRY, nWidth, nHeight, bufWidth, bufHeight);
|
227 |
} |
228 |
|
229 |
/*
|
230 |
* (non-Javadoc)
|
231 |
* @see org.gvsig.fmap.dal.raster.impl.DefaultCoverageStore#close()
|
232 |
*/
|
233 |
public void close() throws CloseException { |
234 |
for (int i = 0; i < list.size(); i++) { |
235 |
list.get(i).close(); |
236 |
} |
237 |
} |
238 |
|
239 |
/*
|
240 |
* (non-Javadoc)
|
241 |
* @see org.gvsig.raster.dataset.IRasterDataSource#copy()
|
242 |
*/
|
243 |
public RasterDataStore newDataStore() {
|
244 |
return list.get(selectedStore).newDataStore();
|
245 |
} |
246 |
|
247 |
/*
|
248 |
* (non-Javadoc)
|
249 |
* @see org.gvsig.raster.dataset.IRasterDataSource#getOwnAffineTransform()
|
250 |
*/
|
251 |
public AffineTransform getOwnAffineTransform() { |
252 |
return list.get(selectedStore).getOwnAffineTransform();
|
253 |
} |
254 |
|
255 |
/*
|
256 |
* (non-Javadoc)
|
257 |
* @see org.gvsig.raster.dataset.IRasterDataSource#getAffineTransform()
|
258 |
*/
|
259 |
public AffineTransform getAffineTransform() { |
260 |
return list.get(selectedStore).getAffineTransform();
|
261 |
} |
262 |
|
263 |
/*
|
264 |
* (non-Javadoc)
|
265 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#setAffineTransform(java.awt.geom.AffineTransform)
|
266 |
*/
|
267 |
public void setAffineTransform(AffineTransform transf){ |
268 |
list.get(selectedStore).setAffineTransform(transf); |
269 |
} |
270 |
|
271 |
/*
|
272 |
* (non-Javadoc)
|
273 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#saveSerialInfoToRmf(org.gvsig.fmap.dal.coverage.store.props.SerialInfo)
|
274 |
*/
|
275 |
public void saveSerialInfoToRmf(TimeSeries serialInfo) throws RmfSerializerException { |
276 |
((AbstractRasterDataStore)list.get(selectedStore)).saveSerialInfoToRmf(serialInfo); |
277 |
} |
278 |
|
279 |
/*
|
280 |
* (non-Javadoc)
|
281 |
* @see org.gvsig.raster.impl.store.AbstractRasterDataStore#saveColorTableToRmf(org.gvsig.fmap.dal.coverage.store.props.ColorTable)
|
282 |
*/
|
283 |
public void saveColorTableToRmf(ColorTable table) throws RmfSerializerException { |
284 |
((AbstractRasterDataStore)list.get(selectedStore)).saveColorTableToRmf(table); |
285 |
} |
286 |
|
287 |
/*
|
288 |
* (non-Javadoc)
|
289 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#loadSerialInfoFromRmf(org.gvsig.fmap.dal.coverage.store.props.SerialInfo)
|
290 |
*/
|
291 |
public boolean loadSerialInfoFromRmf(TimeSeries serialInfo) { |
292 |
return ((AbstractRasterDataStore)list.get(selectedStore)).loadSerialInfoFromRmf(serialInfo);
|
293 |
} |
294 |
|
295 |
/*
|
296 |
* (non-Javadoc)
|
297 |
* @see org.gvsig.raster.dataset.IRasterDataSource#getExtent()
|
298 |
*/
|
299 |
public Extent getExtent() {
|
300 |
return list.get(selectedStore).getExtent();
|
301 |
} |
302 |
|
303 |
/*
|
304 |
* (non-Javadoc)
|
305 |
* @see org.gvsig.raster.dataset.IRasterDataSource#getBandCount()
|
306 |
*/
|
307 |
public int getBandCount() { |
308 |
return list.get(selectedStore).getBandCount();
|
309 |
} |
310 |
|
311 |
/*
|
312 |
* (non-Javadoc)
|
313 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getWidth()
|
314 |
*/
|
315 |
public double getWidth() { |
316 |
return list.get(selectedStore).getWidth();
|
317 |
} |
318 |
|
319 |
/*
|
320 |
* (non-Javadoc)
|
321 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getHeight()
|
322 |
*/
|
323 |
public double getHeight() { |
324 |
return list.get(selectedStore).getHeight();
|
325 |
} |
326 |
|
327 |
/*
|
328 |
* (non-Javadoc)
|
329 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getCellSize()
|
330 |
*/
|
331 |
public double getCellSize() { |
332 |
return list.get(selectedStore).getCellSize();
|
333 |
} |
334 |
|
335 |
/*
|
336 |
* (non-Javadoc)
|
337 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getData(int, int, int)
|
338 |
*/
|
339 |
public Object getData(int x, int y, int band) throws InvalidSetViewException, FileNotOpenException, RasterDriverException { |
340 |
return list.get(selectedStore).getData(x, y, band);
|
341 |
} |
342 |
|
343 |
/*
|
344 |
* (non-Javadoc)
|
345 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getDataType()
|
346 |
*/
|
347 |
public int[] getDataType() { |
348 |
return list.get(selectedStore).getDataType();
|
349 |
} |
350 |
|
351 |
/*
|
352 |
* (non-Javadoc)
|
353 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getDataStoreCount()
|
354 |
*/
|
355 |
public int getDataStoreCount() { |
356 |
return list.size();
|
357 |
} |
358 |
|
359 |
/*
|
360 |
* (non-Javadoc)
|
361 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getFileSize()
|
362 |
*/
|
363 |
public long getFileSize() { |
364 |
return list.get(selectedStore).getFileSize();
|
365 |
} |
366 |
|
367 |
/*
|
368 |
* (non-Javadoc)
|
369 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#isInside(java.awt.geom.Point2D)
|
370 |
*/
|
371 |
public boolean isInside(Point2D p) { |
372 |
return RasterLocator.getManager().getRasterUtils().isInside(p, getExtent(), getAffineTransform());
|
373 |
} |
374 |
|
375 |
/*
|
376 |
* (non-Javadoc)
|
377 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#rasterToWorld(java.awt.geom.Point2D)
|
378 |
*/
|
379 |
public Point2D rasterToWorld(Point2D pt) { |
380 |
return list.get(selectedStore).rasterToWorld(pt);
|
381 |
} |
382 |
|
383 |
/*
|
384 |
* (non-Javadoc)
|
385 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#worldToRaster(java.awt.geom.Point2D)
|
386 |
*/
|
387 |
public Point2D worldToRaster(Point2D pt) { |
388 |
return list.get(selectedStore).worldToRaster(pt);
|
389 |
} |
390 |
|
391 |
/*
|
392 |
* (non-Javadoc)
|
393 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#isRotated()
|
394 |
*/
|
395 |
public boolean isRotated() { |
396 |
return list.get(selectedStore).isRotated();
|
397 |
} |
398 |
|
399 |
/*
|
400 |
* (non-Javadoc)
|
401 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#isGeoreferenced()
|
402 |
*/
|
403 |
public boolean isGeoreferenced() { |
404 |
//Este tipo de datasets siempre est? georreferenciado
|
405 |
return true; |
406 |
} |
407 |
|
408 |
/*
|
409 |
* (non-Javadoc)
|
410 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getBands()
|
411 |
*/
|
412 |
public BandList getBands() {
|
413 |
return list.get(selectedStore).getBands();
|
414 |
} |
415 |
|
416 |
/*
|
417 |
* (non-Javadoc)
|
418 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getWindowRaster(double, double, double, double)
|
419 |
*/
|
420 |
public Buffer getWindow(double ulx, double uly, double w, double h) throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException { |
421 |
return ((QueryableRaster)list.get(selectedStore)).getWindow(ulx, uly, w, h);
|
422 |
} |
423 |
|
424 |
/*
|
425 |
* (non-Javadoc)
|
426 |
* @see org.gvsig.raster.impl.dataset.QueryableRaster#getWindowRaster(double, double, double, double, boolean)
|
427 |
*/
|
428 |
public Buffer getWindow(double ulx, double uly, double w, double h, boolean adjustToExtent) |
429 |
throws InvalidSetViewException, RasterDriverException, ProcessInterruptedException {
|
430 |
return ((QueryableRaster)list.get(selectedStore)).getWindow(ulx, uly, w, h, adjustToExtent);
|
431 |
} |
432 |
|
433 |
/*
|
434 |
* (non-Javadoc)
|
435 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getWindowRaster(double, double, double, double, int, int, org.gvsig.fmap.dal.coverage.grid.render.TileListener, int)
|
436 |
*/
|
437 |
public void getWindow(double ulx, double uly, double lrx, double lry, int bufWidth, int bufHeight, TileListener listener) |
438 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException {
|
439 |
((QueryableRaster)list.get(selectedStore)).getWindow(ulx, uly, lrx, lry, bufWidth, bufHeight, listener); |
440 |
} |
441 |
|
442 |
/*
|
443 |
* (non-Javadoc)
|
444 |
* @see org.gvsig.raster.dataset.IRasterDataSource#getWindowRaster(double, double, double, double, int, int, boolean)
|
445 |
*/
|
446 |
public Buffer getWindow(double ulx, double uly, double lrx, double lry, int bufWidth, int bufHeight, boolean adjustToExtent) |
447 |
throws ProcessInterruptedException, InvalidSetViewException, RasterDriverException {
|
448 |
return ((QueryableRaster)list.get(selectedStore)).getWindow(ulx, uly, lrx, lry, bufWidth, bufHeight, adjustToExtent);
|
449 |
} |
450 |
|
451 |
/*
|
452 |
* (non-Javadoc)
|
453 |
* @see org.gvsig.raster.dataset.IRasterDataSource#getWindowRaster(int, int, int, int)
|
454 |
*/
|
455 |
public Buffer getWindow(int x, int y, int w, int h) |
456 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException {
|
457 |
return ((QueryableRaster)list.get(selectedStore)).getWindow(x, y, w, h);
|
458 |
} |
459 |
|
460 |
/*
|
461 |
* (non-Javadoc)
|
462 |
* @see org.gvsig.raster.dataset.IRasterDataSource#getWindowRaster(int, int, int, int, int, int)
|
463 |
*/
|
464 |
public Buffer getWindow(int x, int y, int w, int h, int bufWidth, int bufHeight) |
465 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException {
|
466 |
return ((QueryableRaster)list.get(selectedStore)).getWindow(x, y, w, h, bufWidth, bufHeight);
|
467 |
} |
468 |
|
469 |
/*
|
470 |
* (non-Javadoc)
|
471 |
* @see org.gvsig.fmap.dal.coverage.dataset.RasterDataSet#getPixelSizeX()
|
472 |
*/
|
473 |
public double getPixelSizeX() { |
474 |
return list.get(selectedStore).getPixelSizeX();
|
475 |
} |
476 |
|
477 |
/*
|
478 |
* (non-Javadoc)
|
479 |
* @see org.gvsig.fmap.dal.coverage.dataset.RasterDataSet#getPixelSizeY()
|
480 |
*/
|
481 |
public double getPixelSizeY() { |
482 |
return list.get(selectedStore).getPixelSizeY();
|
483 |
} |
484 |
|
485 |
/*
|
486 |
* (non-Javadoc)
|
487 |
* @see org.gvsig.raster.impl.store.QueryableRaster#setDrawableBands(int[])
|
488 |
*/
|
489 |
public void setDrawableBands(int[] db) { |
490 |
((QueryableRaster)list.get(selectedStore)).setDrawableBands(db); |
491 |
} |
492 |
|
493 |
/*
|
494 |
* (non-Javadoc)
|
495 |
* @see org.gvsig.raster.impl.dataset.QueryableRaster#clearDrawableBands()
|
496 |
*/
|
497 |
public void clearDrawableBands() { |
498 |
((QueryableRaster)list.get(selectedStore)).clearDrawableBands(); |
499 |
} |
500 |
|
501 |
/*
|
502 |
* (non-Javadoc)
|
503 |
* @see org.gvsig.raster.impl.store.QueryableRaster#addDrawableBand(int, int)
|
504 |
*/
|
505 |
public void addDrawableBand(int posRasterBuf, int imageBand){ |
506 |
((QueryableRaster)list.get(selectedStore)).addDrawableBand(posRasterBuf, imageBand); |
507 |
} |
508 |
|
509 |
/*
|
510 |
* (non-Javadoc)
|
511 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getTransparency()
|
512 |
*/
|
513 |
public Transparency getTransparency() { |
514 |
return list.get(selectedStore).getTransparency();
|
515 |
} |
516 |
|
517 |
/*
|
518 |
* (non-Javadoc)
|
519 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getColorTable()
|
520 |
*/
|
521 |
public ColorTable getColorTable() {
|
522 |
return list.get(selectedStore).getColorTable();
|
523 |
} |
524 |
|
525 |
/*
|
526 |
* (non-Javadoc)
|
527 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getHistogram()
|
528 |
*/
|
529 |
public HistogramComputer getHistogramComputer() throws HistogramException { |
530 |
return list.get(selectedStore).getHistogramComputer();
|
531 |
} |
532 |
|
533 |
/*
|
534 |
* (non-Javadoc)
|
535 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getColorTable(int)
|
536 |
*/
|
537 |
public ColorTable getColorTable(int i){ |
538 |
return ((QueryableRaster)list.get(selectedStore)).getColorTable(i);
|
539 |
} |
540 |
|
541 |
/*
|
542 |
* (non-Javadoc)
|
543 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getColorTable(java.lang.String)
|
544 |
*/
|
545 |
public ColorTable getColorTable(String fileName){ |
546 |
return ((QueryableRaster)list.get(selectedStore)).getColorTable(fileName);
|
547 |
} |
548 |
|
549 |
/*
|
550 |
* (non-Javadoc)
|
551 |
* @see org.gvsig.raster.impl.store.QueryableRaster#setMemoryBuffer(boolean)
|
552 |
*/
|
553 |
public void setMemoryBuffer(boolean memory) { |
554 |
((QueryableRaster)list.get(selectedStore)).setMemoryBuffer(memory); |
555 |
} |
556 |
|
557 |
/*
|
558 |
* (non-Javadoc)
|
559 |
* @see org.gvsig.raster.dataset.RasterDataset#getOverviewCount(int)
|
560 |
*/
|
561 |
public int getOverviewCount(int band) throws BandAccessException, RasterDriverException { |
562 |
return list.get(selectedStore).getOverviewCount(band);
|
563 |
} |
564 |
|
565 |
/*
|
566 |
* (non-Javadoc)
|
567 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#overviewsSupport()
|
568 |
*/
|
569 |
public boolean overviewsSupport() { |
570 |
return list.get(selectedStore).overviewsSupport();
|
571 |
} |
572 |
|
573 |
/*
|
574 |
* (non-Javadoc)
|
575 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getOverviewWidth(int, int)
|
576 |
*/
|
577 |
public int getOverviewWidth(int band, int overview) throws BandAccessException, RasterDriverException { |
578 |
return list.get(selectedStore).getOverviewWidth(band, overview);
|
579 |
} |
580 |
|
581 |
/*
|
582 |
* (non-Javadoc)
|
583 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getOverviewHeight(int, int)
|
584 |
*/
|
585 |
public int getOverviewHeight(int band, int overview) throws BandAccessException, RasterDriverException { |
586 |
return list.get(selectedStore).getOverviewHeight(band, overview);
|
587 |
} |
588 |
|
589 |
/*
|
590 |
* (non-Javadoc)
|
591 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getNoDataValue()
|
592 |
*/
|
593 |
public double getNoDataValue() { |
594 |
return list.get(selectedStore).getNoDataValue();
|
595 |
} |
596 |
|
597 |
/*
|
598 |
* (non-Javadoc)
|
599 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#resetNoDataValue()
|
600 |
*/
|
601 |
public void resetNoDataValue() { |
602 |
list.get(selectedStore).resetNoDataValue(); |
603 |
} |
604 |
|
605 |
/*
|
606 |
* (non-Javadoc)
|
607 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#setNoDataValue(double)
|
608 |
*/
|
609 |
public void setNoDataValue(double value) { |
610 |
list.get(selectedStore).setNoDataValue(value); |
611 |
} |
612 |
|
613 |
/*
|
614 |
* (non-Javadoc)
|
615 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#isNoDataEnabled()
|
616 |
*/
|
617 |
public boolean isNoDataEnabled() { |
618 |
return list.get(selectedStore).isNoDataEnabled();
|
619 |
} |
620 |
|
621 |
/*
|
622 |
* (non-Javadoc)
|
623 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#setNoDataEnabled(boolean)
|
624 |
*/
|
625 |
public void setNoDataEnabled(boolean enabled) { |
626 |
list.get(selectedStore).setNoDataEnabled(enabled); |
627 |
} |
628 |
|
629 |
/*
|
630 |
* (non-Javadoc)
|
631 |
* @see org.gvsig.raster.impl.store.QueryableRaster#getDataStore()
|
632 |
*/
|
633 |
public RasterDataStore getDataStore() {
|
634 |
return this; |
635 |
} |
636 |
|
637 |
/*
|
638 |
* (non-Javadoc)
|
639 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getProjection()
|
640 |
*/
|
641 |
public IProjection getProjection() {
|
642 |
return list.get(selectedStore).getProjection();
|
643 |
} |
644 |
|
645 |
/*
|
646 |
* (non-Javadoc)
|
647 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getView()
|
648 |
*/
|
649 |
public Extent getView() {
|
650 |
return list.get(selectedStore).getView();
|
651 |
} |
652 |
|
653 |
/*
|
654 |
* (non-Javadoc)
|
655 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getExtentWithoutRot()
|
656 |
*/
|
657 |
public Extent getExtentWithoutRot() {
|
658 |
return list.get(selectedStore).getExtentWithoutRot();
|
659 |
} |
660 |
|
661 |
/*
|
662 |
* (non-Javadoc)
|
663 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getMetadata()
|
664 |
*/
|
665 |
public Metadata getMetadata() {
|
666 |
return list.get(selectedStore).getMetadata();
|
667 |
} |
668 |
|
669 |
/*
|
670 |
* (non-Javadoc)
|
671 |
* @see org.gvsig.fmap.dal.coverage.dataset.RasterDataSet#getWktProjection()
|
672 |
*/
|
673 |
public String getWktProjection() throws RasterDriverException { |
674 |
return list.get(selectedStore).getWktProjection();
|
675 |
} |
676 |
|
677 |
/*
|
678 |
* (non-Javadoc)
|
679 |
* @see org.gvsig.fmap.dal.coverage.dataset.RasterDataSet#getColorInterpretation()
|
680 |
*/
|
681 |
public ColorInterpretation getColorInterpretation() {
|
682 |
return list.get(selectedStore).getColorInterpretation();
|
683 |
} |
684 |
|
685 |
/*
|
686 |
* (non-Javadoc)
|
687 |
* @see org.gvsig.fmap.dal.coverage.dataset.RasterDataSet#getStatistics()
|
688 |
*/
|
689 |
public Statistics getStatistics() {
|
690 |
return list.get(selectedStore).getStatistics();
|
691 |
} |
692 |
|
693 |
/*
|
694 |
* (non-Javadoc)
|
695 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#isReproyectable()
|
696 |
*/
|
697 |
public boolean isReproyectable() { |
698 |
return false; |
699 |
} |
700 |
|
701 |
/*
|
702 |
* (non-Javadoc)
|
703 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#isOpen()
|
704 |
*/
|
705 |
public boolean isOpen() { |
706 |
return list.get(selectedStore).isOpen();
|
707 |
} |
708 |
|
709 |
/*
|
710 |
* (non-Javadoc)
|
711 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getTransparencyFilesStatus()
|
712 |
*/
|
713 |
public Transparency getTransparencyFilesStatus() { |
714 |
return list.get(selectedStore).getTransparencyFilesStatus();
|
715 |
} |
716 |
|
717 |
/*
|
718 |
* (non-Javadoc)
|
719 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#saveGeoreferencingToRmf()
|
720 |
*/
|
721 |
public void saveGeoreferencingToRmf() throws RmfSerializerException { |
722 |
list.get(selectedStore).saveGeoreferencingToRmf(); |
723 |
} |
724 |
|
725 |
/*
|
726 |
* (non-Javadoc)
|
727 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#cloneDataStore()
|
728 |
*/
|
729 |
public RasterDataStore cloneDataStore() throws CloneException { |
730 |
return list.get(selectedStore).cloneDataStore();
|
731 |
} |
732 |
|
733 |
/*
|
734 |
* (non-Javadoc)
|
735 |
* @see org.gvsig.metadata.Metadata#getMetadataName()
|
736 |
*/
|
737 |
public String getMetadataName() { |
738 |
try {
|
739 |
return list.get(selectedStore).getMetadataName();
|
740 |
} catch (MetadataException e) {
|
741 |
e.printStackTrace(); |
742 |
} |
743 |
return null; |
744 |
} |
745 |
|
746 |
/*
|
747 |
* (non-Javadoc)
|
748 |
* @see org.gvsig.raster.impl.store.AbstractRasterDataStore#getProvider()
|
749 |
*/
|
750 |
public CoverageStoreProvider getProvider() {
|
751 |
return list.get(selectedStore).getProvider();
|
752 |
} |
753 |
|
754 |
/*
|
755 |
* (non-Javadoc)
|
756 |
* @see org.gvsig.fmap.dal.coverage.store.TRasterStore#getSerialName()
|
757 |
*/
|
758 |
public String getSerialName() { |
759 |
if(list.size() > 0) |
760 |
try {
|
761 |
return list.get(0).getTimeSerials().getName(); |
762 |
} catch (RmfSerializerException e) {
|
763 |
//La serie ya se ha cargado al principio con lo q no deber?a darse
|
764 |
} |
765 |
return null; |
766 |
} |
767 |
|
768 |
/*
|
769 |
* (non-Javadoc)
|
770 |
* @see org.gvsig.fmap.dal.coverage.store.TRasterStore#getSerialDescription()
|
771 |
*/
|
772 |
public String getSerialDescription() { |
773 |
if(list.size() > 0) |
774 |
try {
|
775 |
return list.get(0).getTimeSerials().getDescription(); |
776 |
} catch (RmfSerializerException e) {
|
777 |
//La serie ya se ha cargado al principio con lo q no deber?a darse
|
778 |
} |
779 |
return null; |
780 |
} |
781 |
|
782 |
/*
|
783 |
* (non-Javadoc)
|
784 |
* @see org.gvsig.fmap.dal.coverage.store.TRasterStore#selectSerial(java.lang.String)
|
785 |
*/
|
786 |
public void selectSerial(String serialName) { |
787 |
for (int i = 0; i < list.size(); i++) { |
788 |
TimeSeries sInfo; |
789 |
try {
|
790 |
sInfo = list.get(i).getTimeSerials(); |
791 |
sInfo.selectSerial(serialName); |
792 |
} catch (RmfSerializerException e) {
|
793 |
//La serie ya se ha cargado al principio con lo q no deber?a darse
|
794 |
} |
795 |
} |
796 |
} |
797 |
|
798 |
/*
|
799 |
* (non-Javadoc)
|
800 |
* @see org.gvsig.fmap.dal.coverage.store.TRasterStore#setSerialDescription(java.lang.String)
|
801 |
*/
|
802 |
public void setSerialDescription(String serialDescription) { |
803 |
for (int i = 0; i < list.size(); i++) { |
804 |
TimeSeries sInfo; |
805 |
try {
|
806 |
sInfo = list.get(i).getTimeSerials(); |
807 |
sInfo.setDescription(serialDescription); |
808 |
} catch (RmfSerializerException e) {
|
809 |
//La serie ya se ha cargado al principio con lo q no deber?a darse
|
810 |
} |
811 |
} |
812 |
} |
813 |
|
814 |
/*
|
815 |
* (non-Javadoc)
|
816 |
* @see org.gvsig.fmap.dal.coverage.store.TRasterStore#setSerialName(java.lang.String)
|
817 |
*/
|
818 |
public void setSerialName(String serialName) { |
819 |
for (int i = 0; i < list.size(); i++) { |
820 |
TimeSeries sInfo; |
821 |
try {
|
822 |
sInfo = list.get(i).getTimeSerials(); |
823 |
sInfo.setName(serialName); |
824 |
} catch (RmfSerializerException e) {
|
825 |
//La serie ya se ha cargado al principio con lo q no deber?a darse
|
826 |
} |
827 |
} |
828 |
} |
829 |
|
830 |
/*
|
831 |
* (non-Javadoc)
|
832 |
* @see org.gvsig.fmap.dal.coverage.store.RemoteRasterStore#getInfoByPoint(double, double)
|
833 |
*/
|
834 |
public String getInfoByPoint(double x, double y, ICancellable cancellable) throws RemoteServiceException { |
835 |
return list.get(selectedStore).getInfoByPoint(x, y, cancellable);
|
836 |
} |
837 |
|
838 |
public void addDataStore(String[] fileName) |
839 |
throws FileNotFoundInListException, NotSupportedExtensionException,
|
840 |
RasterDriverException, OperationNotSupportedException {
|
841 |
list.get(selectedStore).addDataStore(fileName); |
842 |
} |
843 |
|
844 |
public void addDataStore(String fileName) |
845 |
throws FileNotFoundInListException, NotSupportedExtensionException,
|
846 |
RasterDriverException, OperationNotSupportedException {
|
847 |
list.get(selectedStore).addDataStore(fileName); |
848 |
} |
849 |
|
850 |
public ColorInterpretation getColorInterpretation(int dataset) { |
851 |
return list.get(selectedStore).getColorInterpretation(dataset);
|
852 |
} |
853 |
|
854 |
public RasterDataStore getDataStore(int i) { |
855 |
return list.get(selectedStore).getDataStore(i);
|
856 |
} |
857 |
|
858 |
public RasterDataStore getDataStore(String fileName) { |
859 |
return list.get(selectedStore).getDataStore(fileName);
|
860 |
} |
861 |
|
862 |
public String getFName(int file) { |
863 |
return list.get(selectedStore).getFName(file);
|
864 |
} |
865 |
|
866 |
public String[] getNameDatasetStringList() { |
867 |
return list.get(selectedStore).getNameDatasetStringList();
|
868 |
} |
869 |
|
870 |
public void removeDataStore(String fileName) |
871 |
throws OperationNotSupportedException { |
872 |
list.get(selectedStore).removeDataStore(fileName); |
873 |
} |
874 |
|
875 |
public void removeDataStore(RasterDataStore file) |
876 |
throws OperationNotSupportedException { |
877 |
list.get(selectedStore).removeDataStore(file); |
878 |
} |
879 |
|
880 |
public void addDataStore(RasterDataStore f) |
881 |
throws FileNotFoundInListException, OperationNotSupportedException, |
882 |
InvalidSourceException { |
883 |
list.get(selectedStore).addDataStore(f); |
884 |
} |
885 |
|
886 |
public Extent getCoordsInLevel(Point2D viewCenter, int level, int w, int h) { |
887 |
return null; |
888 |
} |
889 |
|
890 |
public Extent getCoordsInTheNearestLevel(Extent extent, int w, int h) { |
891 |
return null; |
892 |
} |
893 |
|
894 |
/*
|
895 |
* (non-Javadoc)
|
896 |
* @see org.gvsig.fmap.dal.coverage.store.RemoteRasterStore#getZoomLevels()
|
897 |
*/
|
898 |
public int getZoomLevels() { |
899 |
return list.get(selectedStore).getZoomLevels();
|
900 |
} |
901 |
|
902 |
/*
|
903 |
* (non-Javadoc)
|
904 |
* @see org.gvsig.fmap.dal.coverage.store.RemoteRasterStore#getNearestLevel(double)
|
905 |
*/
|
906 |
public int getNearestLevel(double pixelSize) { |
907 |
return list.get(selectedStore).getNearestLevel(pixelSize);
|
908 |
} |
909 |
|
910 |
/*
|
911 |
* (non-Javadoc)
|
912 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#setTileServer(java.lang.Class)
|
913 |
*/
|
914 |
public void setTileServer(Class<?> tileServer) { |
915 |
list.get(selectedStore).setTileServer(tileServer); |
916 |
} |
917 |
|
918 |
/*
|
919 |
* (non-Javadoc)
|
920 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#isRasterEnclosed()
|
921 |
*/
|
922 |
public boolean isRasterEnclosed() { |
923 |
return list.get(selectedStore).isRasterEnclosed();
|
924 |
} |
925 |
} |