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 / AbstractRasterDataStore.java @ 234
History | View | Annotate | Download (36.7 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.Dimension; |
25 |
import java.awt.geom.Point2D; |
26 |
import java.awt.geom.Rectangle2D; |
27 |
import java.util.Iterator; |
28 |
import java.util.Set; |
29 |
|
30 |
import org.gvsig.fmap.dal.DataQuery; |
31 |
import org.gvsig.fmap.dal.DataServerExplorer; |
32 |
import org.gvsig.fmap.dal.DataSet; |
33 |
import org.gvsig.fmap.dal.DataStore; |
34 |
import org.gvsig.fmap.dal.DataStoreParameters; |
35 |
import org.gvsig.fmap.dal.coverage.RasterLocator; |
36 |
import org.gvsig.fmap.dal.coverage.dataset.Buffer; |
37 |
import org.gvsig.fmap.dal.coverage.datastruct.Extent; |
38 |
import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException; |
39 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
40 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
41 |
import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException; |
42 |
import org.gvsig.fmap.dal.coverage.grid.render.Render; |
43 |
import org.gvsig.fmap.dal.coverage.grid.render.TileListener; |
44 |
import org.gvsig.fmap.dal.coverage.process.vector.Vectorization; |
45 |
import org.gvsig.fmap.dal.coverage.store.RasterDataStore; |
46 |
import org.gvsig.fmap.dal.coverage.store.RasterFileStoreParameters; |
47 |
import org.gvsig.fmap.dal.coverage.store.RasterQuery; |
48 |
import org.gvsig.fmap.dal.coverage.store.RasterDataParameters; |
49 |
import org.gvsig.fmap.dal.coverage.store.props.ColorTable; |
50 |
import org.gvsig.fmap.dal.coverage.store.props.SerialInfo; |
51 |
import org.gvsig.fmap.dal.coverage.util.RasterUtils; |
52 |
import org.gvsig.fmap.dal.exception.DataException; |
53 |
import org.gvsig.fmap.dal.exception.InitializeException; |
54 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
55 |
import org.gvsig.fmap.dal.feature.FeatureStoreNotification; |
56 |
import org.gvsig.fmap.dal.feature.impl.DefaultFeatureStoreNotification; |
57 |
import org.gvsig.fmap.dal.impl.DataStoreImplementation; |
58 |
import org.gvsig.fmap.dal.impl.DefaultDataManager; |
59 |
import org.gvsig.fmap.dal.raster.CoverageSelection; |
60 |
import org.gvsig.fmap.dal.raster.CoverageStore; |
61 |
import org.gvsig.fmap.dal.raster.spi.CoverageStoreProvider; |
62 |
import org.gvsig.fmap.dal.raster.spi.CoverageStoreProviderServices; |
63 |
import org.gvsig.fmap.dal.resource.Resource; |
64 |
import org.gvsig.fmap.dal.spi.DataStoreProvider; |
65 |
import org.gvsig.metadata.MetadataLocator; |
66 |
import org.gvsig.metadata.MetadataManager; |
67 |
import org.gvsig.metadata.exceptions.MetadataException; |
68 |
import org.gvsig.raster.impl.DefaultRasterManager; |
69 |
import org.gvsig.raster.impl.buffer.DefaultRasterQuery; |
70 |
import org.gvsig.raster.impl.datastruct.ExtentImpl; |
71 |
import org.gvsig.raster.impl.grid.render.DefaultRender; |
72 |
import org.gvsig.raster.impl.process.vector.PotraceVectorization; |
73 |
import org.gvsig.raster.impl.store.properties.DataStoreSerialInfo; |
74 |
import org.gvsig.tools.ToolsLocator; |
75 |
import org.gvsig.tools.dispose.impl.AbstractDisposable; |
76 |
import org.gvsig.tools.dynobject.DelegatedDynObject; |
77 |
import org.gvsig.tools.dynobject.DynClass; |
78 |
import org.gvsig.tools.dynobject.DynObject; |
79 |
import org.gvsig.tools.dynobject.DynObjectManager; |
80 |
import org.gvsig.tools.dynobject.DynStruct; |
81 |
import org.gvsig.tools.dynobject.exception.DynFieldNotFoundException; |
82 |
import org.gvsig.tools.dynobject.exception.DynMethodException; |
83 |
import org.gvsig.tools.exception.BaseException; |
84 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
85 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
86 |
import org.gvsig.tools.observer.impl.DelegateWeakReferencingObservable; |
87 |
import org.gvsig.tools.persistence.PersistentState; |
88 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
89 |
import org.gvsig.tools.undo.command.Command; |
90 |
import org.gvsig.tools.visitor.Visitor; |
91 |
|
92 |
/**
|
93 |
* Default implementation for RasterDataSource
|
94 |
*
|
95 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
96 |
*/
|
97 |
public abstract class AbstractRasterDataStore extends AbstractDisposable |
98 |
implements RasterDataStore, CoverageStoreProviderServices, DataStoreImplementation, QueryableRaster {
|
99 |
protected DefaultRasterQuery currentQuery = null; |
100 |
/**
|
101 |
* Lista de paletas asociadas a las bandas cargadas en el DataSource. Estas son calculadas
|
102 |
* en las funciones que asignan las bandas a dibujar (addDrawableBands)
|
103 |
*/
|
104 |
private ColorTable[] palette = null; |
105 |
/**
|
106 |
* Extensi?n de los datos del buffer
|
107 |
*/
|
108 |
private Extent dataExtent = null; |
109 |
/**
|
110 |
* Ancho y alto en pixeles del ?ltimo buffer asignado
|
111 |
*/
|
112 |
protected double nWidth = 0; |
113 |
protected double nHeight = 0; |
114 |
private double[] step = null; |
115 |
private Buffer lastBuffer = null; |
116 |
|
117 |
private DefaultDataManager dataManager = null; |
118 |
protected DataStoreParameters parameters = null; |
119 |
private DelegatedDynObject metadata = null; |
120 |
private RasterUtils util = null; |
121 |
private SerialInfo serialInfo = null; |
122 |
private DelegateWeakReferencingObservable
|
123 |
delegateObservable = new DelegateWeakReferencingObservable(this); |
124 |
private Render render = null; |
125 |
|
126 |
public AbstractRasterDataStore() {
|
127 |
util = RasterLocator.getManager().getRasterUtils(); |
128 |
} |
129 |
|
130 |
/*
|
131 |
* (non-Javadoc)
|
132 |
* @see org.gvsig.fmap.dal.coverage.buffer.RasterDataSource#query(org.gvsig.fmap.dal.coverage.buffer.RasterQuery)
|
133 |
*/
|
134 |
public Buffer query(RasterQuery query) |
135 |
throws ProcessInterruptedException, RasterDriverException,
|
136 |
InvalidSetViewException { |
137 |
currentQuery = (DefaultRasterQuery)query; |
138 |
|
139 |
if(currentQuery.getDrawableBands() != null) |
140 |
setQueryDrawableBands(currentQuery.getDrawableBands()); |
141 |
else
|
142 |
setQueryAllDrawableBands(); |
143 |
|
144 |
setMemoryBuffer(currentQuery.isMemoryBuffer()); |
145 |
|
146 |
Buffer buf = null; |
147 |
if(currentQuery.getType() == DefaultRasterQuery.TYPE_ENTIRE) {
|
148 |
buf = setAreaOfInterest(); |
149 |
Extent e = getExtent(); |
150 |
buf.setDataExtent(new Rectangle2D.Double(e.getULX(), e.getULY(), e.getMax().getX() - e.getMin().getX(), e.getMax().getY() - e.getMin().getY())); |
151 |
} |
152 |
|
153 |
if(currentQuery.getType() == DefaultRasterQuery.TYPE_COORDS) {
|
154 |
buf = setAreaOfInterest(currentQuery.getX(), currentQuery.getY(), currentQuery.getW(), currentQuery.getH()); |
155 |
buf.setDataExtent(new Rectangle2D.Double(currentQuery.getX(), currentQuery.getY(), currentQuery.getW(), currentQuery.getH())); |
156 |
} |
157 |
|
158 |
if(currentQuery.getType() == DefaultRasterQuery.TYPE_COORDS_SIZE) {
|
159 |
buf = setAreaOfInterest(currentQuery.getUlx(), currentQuery.getUly(), currentQuery.getLrx(), currentQuery.getLry(), currentQuery.getBufWidth(), currentQuery.getBufHeight()); |
160 |
buf.setDataExtent(new Rectangle2D.Double(currentQuery.getUlx(), currentQuery.getUly(), currentQuery.getLrx() - currentQuery.getUlx(), currentQuery.getLry() - currentQuery.getUly())); |
161 |
} |
162 |
|
163 |
if(currentQuery.getType() == DefaultRasterQuery.TYPE_COORDS_SIZE_TILED) {
|
164 |
setAreaOfInterest(currentQuery.getUlx(), currentQuery.getUly(), currentQuery.getLrx(), currentQuery.getLry(), currentQuery.getBufWidth(), currentQuery.getBufHeight(), currentQuery.getTileListener()); |
165 |
} |
166 |
|
167 |
if(currentQuery.getType() == DefaultRasterQuery.TYPE_PX)
|
168 |
buf = setAreaOfInterest(currentQuery.getPixelX(), currentQuery.getPixelY(), currentQuery.getPixelW(), currentQuery.getPixelH()); |
169 |
|
170 |
if(currentQuery.getType() == DefaultRasterQuery.TYPE_PX_SIZE)
|
171 |
buf = setAreaOfInterest(currentQuery.getPixelX(), currentQuery.getPixelY(), currentQuery.getPixelW(), currentQuery.getPixelH(), currentQuery.getBufWidth(), currentQuery.getBufHeight()); |
172 |
|
173 |
if(currentQuery.isStoredLastBuffer())
|
174 |
lastBuffer = buf; |
175 |
else
|
176 |
lastBuffer = null;
|
177 |
currentQuery.storeLastBuffer(false);
|
178 |
|
179 |
if(buf != null) { |
180 |
buf.setStore(this);
|
181 |
buf.setNoDataValue(getNoDataValue()); |
182 |
return buf;
|
183 |
} |
184 |
return null; |
185 |
} |
186 |
|
187 |
/*
|
188 |
* (non-Javadoc)
|
189 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getAdjustedToExtent(org.gvsig.fmap.dal.coverage.datastruct.Extent)
|
190 |
*/
|
191 |
public Extent adjustToExtent(Extent e) {
|
192 |
Extent currentExtent = this.getExtent();
|
193 |
|
194 |
double minx = e.getMin().getX() < currentExtent.getMin().getX() ? currentExtent.getMin().getX() : e.getMin().getX();
|
195 |
double maxx = e.getMax().getX() > currentExtent.getMax().getX() ? currentExtent.getMax().getX() : e.getMax().getX();
|
196 |
double miny = e.getMin().getY() < currentExtent.getMin().getY() ? currentExtent.getMin().getY() : e.getMin().getY();
|
197 |
double maxy = e.getMax().getY() > currentExtent.getMax().getY() ? currentExtent.getMax().getY() : e.getMax().getY();
|
198 |
|
199 |
return new ExtentImpl(minx, maxy, maxx, miny); |
200 |
} |
201 |
|
202 |
public String getFullName() { |
203 |
return getName();
|
204 |
} |
205 |
|
206 |
/*
|
207 |
* (non-Javadoc)
|
208 |
* @see org.gvsig.fmap.dal.coverage.buffer.RasterDataSource#getLastBuffer()
|
209 |
*/
|
210 |
public Buffer getLastBuffer() { |
211 |
return lastBuffer;
|
212 |
} |
213 |
|
214 |
/*
|
215 |
* (non-Javadoc)
|
216 |
* @see org.gvsig.fmap.dal.coverage.buffer.RasterDataSource#getStep()
|
217 |
*/
|
218 |
public double[] getStep() { |
219 |
return step;
|
220 |
} |
221 |
|
222 |
/**
|
223 |
* Asigna el ?rea de inter?s a toda la extensi?n del raster.
|
224 |
*/
|
225 |
protected Buffer setAreaOfInterest() |
226 |
throws ProcessInterruptedException, InvalidSetViewException, RasterDriverException {
|
227 |
step = null;
|
228 |
dataExtent = getExtent(); |
229 |
return getWindowRaster(0, 0, (int)getWidth(), (int)getHeight()); |
230 |
} |
231 |
|
232 |
/**
|
233 |
* Asigna el ?rea de interes en coordenadas del mundo real. Si las coordenadas exceden del tama?o de la imagen
|
234 |
* estas coordenadas son ajustadas el extent.
|
235 |
* @param x Coordenada X, esquina superior izquierda
|
236 |
* @param y Coordenada Y, esquina superior izquierda
|
237 |
* @param w Ancho del ?rea
|
238 |
* @param h Alto del ?rea
|
239 |
* @throws ArrayIndexOutOfBoundsException
|
240 |
* @throws InvalidSetViewException
|
241 |
*/
|
242 |
protected Buffer setAreaOfInterest(double x, double y, double w, double h) |
243 |
throws RasterDriverException, InvalidSetViewException, ProcessInterruptedException {
|
244 |
step = null;
|
245 |
dataExtent = new ExtentImpl(x, y, x + w, y - h);
|
246 |
|
247 |
Extent adjustedDataExtent = util.calculateAdjustedView(dataExtent, getAffineTransform(), new Dimension((int)getWidth(), (int)getHeight())); |
248 |
|
249 |
return getWindowRaster(adjustedDataExtent.getMin().getX(), adjustedDataExtent.getMax().getY(), adjustedDataExtent.width(), adjustedDataExtent.height(), currentQuery.isAdjustToExtent());
|
250 |
} |
251 |
|
252 |
public void setAreaOfInterest(double ulx, double uly, double lrx, double lry, |
253 |
int bufWidth, int bufHeight, TileListener listener) throws RasterDriverException, InvalidSetViewException, ProcessInterruptedException { |
254 |
step = null;
|
255 |
dataExtent = new ExtentImpl(ulx, uly, lrx, lry);
|
256 |
((RasterDataParameters)getParameters()).setAlphaBand(currentQuery.getAlphaBandNumber()); |
257 |
getWindowRaster(ulx, uly, lrx, lry, bufWidth, bufHeight, listener); |
258 |
} |
259 |
|
260 |
/**
|
261 |
* Asigna el ?rea de interes en coordenadas del mundo real. Si las coordenadas exceden del tama?o de la imagen
|
262 |
* estas coordenadas son ajustadas el extent.
|
263 |
* @param x Coordenada X, esquina superior izquierda
|
264 |
* @param y Coordenada Y, esquina superior izquierda
|
265 |
* @param w Ancho del ?rea
|
266 |
* @param h Alto del ?rea
|
267 |
* @param bufWidth Ancho del buffer
|
268 |
* @param bufHeight Alto del buffer
|
269 |
* @return En caso de que el buffer sea mayor que el tama?o seleccionado de raster se produce supersampleo. La funci?n devuelve
|
270 |
* un array de dos elementos que representan el desplazamiento en pixels de X e Y de la esquina superior izquierda.
|
271 |
* @throws ArrayIndexOutOfBoundsException
|
272 |
* @throws InvalidSetViewException
|
273 |
*/
|
274 |
protected Buffer setAreaOfInterest(double ulx, double uly, double lrx, double lry, int bufWidth, int bufHeight) |
275 |
throws RasterDriverException, InvalidSetViewException, ProcessInterruptedException {
|
276 |
step = null;
|
277 |
dataExtent = new ExtentImpl(ulx, uly, lrx, lry);
|
278 |
Extent adjustedDataExtent = util.calculateAdjustedView(dataExtent, getAffineTransform(), new Dimension((int)getWidth(), (int)getHeight())); |
279 |
|
280 |
//Caso 3D: La petici?n no se ajusta al ?rea y se rellena el exterior con NoData
|
281 |
if(!currentQuery.isAdjustToExtent() && !util.isInside(dataExtent, getExtent())) {
|
282 |
return requestFillingWithNoData(dataExtent, adjustedDataExtent, bufWidth, bufHeight);
|
283 |
} |
284 |
|
285 |
//Esta secci?n es para que no supersamplee el driver y pueda hacerse en el cliente
|
286 |
if(!currentQuery.isSupersamplingLoadingBuffer()) {
|
287 |
//nWidth = ((adjustedDataExtent.width() * mDataset.getDataset(0).getWidth()) / mDataset.getExtentForRequest().width());
|
288 |
//nHeight = ((adjustedDataExtent.height() * mDataset.getDataset(0).getHeight()) / mDataset.getExtentForRequest().height());
|
289 |
Point2D p1 = worldToRaster(new Point2D.Double(adjustedDataExtent.getULX(), adjustedDataExtent.getULY())); |
290 |
Point2D p2 = worldToRaster(new Point2D.Double(adjustedDataExtent.getLRX(), adjustedDataExtent.getLRY())); |
291 |
nWidth = Math.abs(p1.getX() - p2.getX());
|
292 |
nHeight = Math.abs(p1.getY() - p2.getY());
|
293 |
|
294 |
if(bufWidth > Math.ceil(nWidth) && bufHeight > Math.ceil(nHeight)) { |
295 |
step = calcSteps(adjustedDataExtent.getULX(), adjustedDataExtent.getULY(), adjustedDataExtent.getLRX(), adjustedDataExtent.getLRY(), nWidth, nHeight, bufWidth, bufHeight); |
296 |
return getWindowRaster(adjustedDataExtent.getULX(), adjustedDataExtent.getULY(), adjustedDataExtent.getLRX(), adjustedDataExtent.getLRY());
|
297 |
} |
298 |
} |
299 |
return getWindowRaster(adjustedDataExtent.getULX(), adjustedDataExtent.getULY(), adjustedDataExtent.getLRX(), adjustedDataExtent.getLRY(), bufWidth, bufHeight, true /*Siempre ajustado*/); |
300 |
} |
301 |
|
302 |
/**
|
303 |
* Asigna el ?rea de interes en coordenadas pixel. Si las coordenadas exceden del tama?o de la imagen
|
304 |
* lanza una excepci?n.
|
305 |
* @param x Coordenada X, esquina superior izquierda
|
306 |
* @param y Coordenada Y, esquina superior izquierda
|
307 |
* @param w Ancho del ?rea
|
308 |
* @param h Alto del ?rea
|
309 |
* @throws InvalidSetViewException
|
310 |
* @throws ArrayIndexOutOfBoundsException
|
311 |
*/
|
312 |
protected Buffer setAreaOfInterest(int x, int y, int w, int h) |
313 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException {
|
314 |
step = null;
|
315 |
if(x > getSourceWidth() || y > getSourceHeight())
|
316 |
throw new InvalidSetViewException("Par?metros incorrectos en setAreaOfInterest"); |
317 |
x = (x < 0) ? 0 : x; |
318 |
y = (y < 0) ? 0 : y; |
319 |
w = (w > getSourceWidth()) ? getSourceWidth() : w; |
320 |
h = (h > getSourceHeight()) ? getSourceHeight() : h; |
321 |
|
322 |
dataExtent = new ExtentImpl(rasterToWorld(new Point2D.Double(x, y)), |
323 |
rasterToWorld(new Point2D.Double(x + w, y + h))); |
324 |
return getWindowRaster(x, y, w, h);
|
325 |
} |
326 |
|
327 |
/**
|
328 |
* Asigna el ?rea de interes en coordenadas pixel. Esta operaci?n cargar? un RasterBuffer con los datos solicitados por
|
329 |
* lo que, si al acabar hacemos getRasterBuf obtendremos la matriz de datos. Si las coordenadas exceden del tama?o
|
330 |
* de la imagen lanza una excepci?n.
|
331 |
* @param x Coordenada X, esquina superior izquierda
|
332 |
* @param y Coordenada Y, esquina superior izquierda
|
333 |
* @param w Ancho del ?rea
|
334 |
* @param h Alto del ?rea
|
335 |
* @param bufWidth Ancho del buffer
|
336 |
* @param bufHeight Alto del buffer
|
337 |
* @throws ArrayIndexOutOfBoundsException
|
338 |
*/
|
339 |
protected Buffer setAreaOfInterest(int x, int y, int w, int h, int bufWidth, int bufHeight) |
340 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException {
|
341 |
step = null;
|
342 |
if(x > getSourceWidth() || y > getSourceHeight())
|
343 |
throw new InvalidSetViewException("Par?metros incorrectos en setAreaOfInterest"); |
344 |
|
345 |
x = (x < 0) ? 0 : x; |
346 |
y = (y < 0) ? 0 : y; |
347 |
w = (w > getSourceWidth()) ? getSourceWidth() : w; |
348 |
h = (h > getSourceHeight()) ? getSourceHeight() : h; |
349 |
|
350 |
dataExtent = new ExtentImpl(rasterToWorld(new Point2D.Double(x, y)), |
351 |
rasterToWorld(new Point2D.Double(x + w, y + h))); |
352 |
|
353 |
return getWindowRaster(x, y, w, h, bufWidth, bufHeight);
|
354 |
} |
355 |
|
356 |
|
357 |
/**
|
358 |
* Para este GeoRasterFile asigna que bandas se pintaran
|
359 |
* sobre el RasterBuf cuando se haga un update. Cada posici?n del vector es una banda
|
360 |
* del rasterBuf y el contenido de esa posici?n es la banda de la imagen que se dibujar?
|
361 |
* sobre ese RasterBuf.
|
362 |
* @param drawableBands Array con las bandas a dibujar.
|
363 |
* @return array con tantos elementos como bandas a dibujar. El valor contenido es el fichero del
|
364 |
* dataset multifichero al que corresponde la banda.
|
365 |
*/
|
366 |
private void setQueryDrawableBands(int[] drawableBands) { |
367 |
//clearDrawableBands();
|
368 |
setDrawableBands(drawableBands); |
369 |
|
370 |
int[] files = new int[drawableBands.length]; |
371 |
palette = new ColorTable[drawableBands.length];
|
372 |
|
373 |
for(int i = 0; i< drawableBands.length; i++) { |
374 |
if(drawableBands[i] < 0 || drawableBands[i] >= getBandCount()) |
375 |
continue;
|
376 |
//addDrawableBand(i, drawableBands[i]);
|
377 |
String fileName = getBands().getBand(drawableBands[i]).getFileName();
|
378 |
files[i] = getBands().getFileNumber(fileName); |
379 |
palette[i] = getColorTable(fileName); |
380 |
} |
381 |
} |
382 |
|
383 |
/**
|
384 |
* Para este GeoRasterFile asigna que bandas se pintaran
|
385 |
* sobre el RasterBuf cuando se haga un update. Cada posici?n del vector es una banda
|
386 |
* del rasterBuf y el contenido de esa posici?n es la banda de la imagen que se dibujar?
|
387 |
* sobre ese RasterBuf. Esta llamada asigna todas las bandas dibujables en su orden natural.
|
388 |
* @return array con tantos elementos como bandas a dibujar. El valor contenido es el fichero del
|
389 |
* dataset multifichero al que corresponde la banda.
|
390 |
*/
|
391 |
public int[] setQueryAllDrawableBands() { |
392 |
clearDrawableBands(); |
393 |
|
394 |
int[] list = new int[getBandCount()]; |
395 |
for(int i = 0; i< getBandCount(); i++) |
396 |
list[i] = i; |
397 |
setDrawableBands(list); |
398 |
|
399 |
int[] files = new int[getBandCount()]; |
400 |
palette = new ColorTable[getBandCount()];
|
401 |
|
402 |
for(int i = 0; i< getBandCount(); i++) { |
403 |
addDrawableBand(i, i); |
404 |
String fileName = getBands().getBand(i).getFileName();
|
405 |
files[i] = getBands().getFileNumber(fileName); |
406 |
palette[i] = getColorTable(fileName); |
407 |
} |
408 |
return files;
|
409 |
} |
410 |
|
411 |
/**
|
412 |
* M?todo que crea un buffer con la extensi?n que se ha pedido completa y sin ajustar
|
413 |
* a la extensi?n del raster. La zona que tenga informaci?n del raster se rellenara con
|
414 |
* esta y la que quede vacia se rellenar? con valores NoData. El ancho y alto del buffer corresponden
|
415 |
* a toda la zona solicitada, tanto la que cae dentro como la rellena con Nodata
|
416 |
*
|
417 |
* @param rasterBuf Buffer de salida.
|
418 |
* @throws InvalidSetViewException
|
419 |
*/
|
420 |
private Buffer requestFillingWithNoData(Extent requestExtent, Extent fitExtent, int bufWidth, int bufHeight) |
421 |
throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException {
|
422 |
double error = 0.01; |
423 |
//Upper Left
|
424 |
double distWcX = Math.abs(fitExtent.getMin().getX() - dataExtent.getMin().getX()); |
425 |
distWcX = (distWcX > error) ? distWcX : 0;
|
426 |
double distWcY = Math.abs(fitExtent.getMax().getY() - dataExtent.getMax().getY()); |
427 |
distWcY = (distWcY > error) ? distWcY : 0;
|
428 |
//Pixel inicial del buffer donde se empieza a dibujar. Redondeamos por arriba pq lo que sobra se pone NoData
|
429 |
double initPxX = Math.ceil((distWcX * bufWidth) / requestExtent.width()); |
430 |
double initPxY = Math.ceil((distWcY * bufHeight) / requestExtent.height()); |
431 |
|
432 |
//Lower Right
|
433 |
distWcX = Math.abs(fitExtent.getMax().getX() - dataExtent.getMin().getX());
|
434 |
distWcX = (distWcX > error) ? distWcX : 0;
|
435 |
distWcY = Math.abs(fitExtent.getMin().getY() - dataExtent.getMax().getY());
|
436 |
distWcY = (distWcY > error) ? distWcY : 0;
|
437 |
//Pixel final del buffer donde se dibuja. Redondeamos por abajo pq lo que sobra se pone NoData
|
438 |
double endPxX = Math.floor((distWcX * bufWidth) / requestExtent.width()); |
439 |
double endPxY = Math.floor((distWcY * bufHeight) / requestExtent.height()); |
440 |
|
441 |
int copyX = (int)Math.abs(endPxX - initPxX); |
442 |
int copyY = (int)Math.abs(endPxY - initPxY); |
443 |
|
444 |
Buffer rasterBuf = getWindowRaster(fitExtent.getULX(), fitExtent.getULY(), fitExtent.getLRX(), fitExtent.getLRY(), copyX, copyY, true); |
445 |
Buffer buf = DefaultRasterManager.getInstance().createBuffer(getDataType()[0], bufWidth, bufHeight, rasterBuf.getBandCount(), true); |
446 |
buf.setNoDataValue(currentQuery.getNoDataValueToFill()); |
447 |
for(int i = 0; i < buf.getBandCount(); i++) { |
448 |
switch(buf.getDataType()) {
|
449 |
case Buffer.TYPE_BYTE:buf.assign(i, buf.getByteNoDataValue());break; |
450 |
case Buffer.TYPE_SHORT:buf.assign(i, buf.getShortNoDataValue());break; |
451 |
case Buffer.TYPE_INT:buf.assign(i, buf.getIntNoDataValue());break; |
452 |
case Buffer.TYPE_FLOAT:buf.assign(i, buf.getFloatNoDataValue());break; |
453 |
case Buffer.TYPE_DOUBLE:buf.assign(i, buf.getNoDataValue());break; |
454 |
} |
455 |
} |
456 |
|
457 |
switch(rasterBuf.getDataType()) {
|
458 |
case Buffer.TYPE_BYTE: |
459 |
for (int iBand = 0; iBand < rasterBuf.getBandCount(); iBand++) |
460 |
for (int row = 0; row < copyY; row++) |
461 |
for (int col = 0; col < copyX; col++) |
462 |
buf.setElem((int)(row + initPxY), (int)(col + initPxX), |
463 |
iBand, |
464 |
rasterBuf.getElemByte(row, col, iBand)); |
465 |
break;
|
466 |
case Buffer.TYPE_SHORT: |
467 |
case Buffer.TYPE_USHORT: |
468 |
for (int iBand = 0; iBand < rasterBuf.getBandCount(); iBand++) |
469 |
for (int row = 0; row < copyY; row++) |
470 |
for (int col = 0; col < copyX; col++) |
471 |
buf.setElem((int)(row + initPxY), (int)(col + initPxX), |
472 |
iBand, |
473 |
rasterBuf.getElemShort(row, col, iBand)); |
474 |
break;
|
475 |
case Buffer.TYPE_INT: |
476 |
for (int iBand = 0; iBand < rasterBuf.getBandCount(); iBand++) |
477 |
for (int row = 0; row < copyY; row++) |
478 |
for (int col = 0; col < copyX; col++) |
479 |
buf.setElem((int)(row + initPxY), (int)(col + initPxX), |
480 |
iBand, |
481 |
rasterBuf.getElemInt(row, col, iBand)); |
482 |
break;
|
483 |
case Buffer.TYPE_FLOAT: |
484 |
for (int iBand = 0; iBand < rasterBuf.getBandCount(); iBand++) |
485 |
for (int row = 0; row < copyY; row++) |
486 |
for (int col = 0; col < copyX; col++) |
487 |
buf.setElem((int)(row + initPxY), (int)(col + initPxX), |
488 |
iBand, |
489 |
rasterBuf.getElemFloat(row, col, iBand)); |
490 |
break;
|
491 |
case Buffer.TYPE_DOUBLE: |
492 |
for (int iBand = 0; iBand < rasterBuf.getBandCount(); iBand++) |
493 |
for (int row = 0; row < copyY; row++) |
494 |
for (int col = 0; col < copyX; col++) |
495 |
buf.setElem((int)(row + initPxY), (int)(col + initPxX), |
496 |
iBand, |
497 |
rasterBuf.getElemDouble(row, col, iBand)); |
498 |
break;
|
499 |
} |
500 |
return buf;
|
501 |
} |
502 |
|
503 |
/*
|
504 |
* (non-Javadoc)
|
505 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getSerialInfo()
|
506 |
*/
|
507 |
public SerialInfo getSerialInfo() throws RmfSerializerException { |
508 |
if(serialInfo == null) { |
509 |
serialInfo = new DataStoreSerialInfo();
|
510 |
loadSerialInfoFromRmf(serialInfo); |
511 |
//Seleccionamos la primera serie por defecto. El usuario seleccionar? otra si la necesita
|
512 |
serialInfo.selectSerial(0);
|
513 |
} |
514 |
return serialInfo;
|
515 |
} |
516 |
|
517 |
/*
|
518 |
* (non-Javadoc)
|
519 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#setSerialInfo()
|
520 |
*/
|
521 |
public void setSerialInfo(SerialInfo serialInfo) throws RmfSerializerException { |
522 |
this.serialInfo = serialInfo;
|
523 |
saveSerialInfoToRmf(serialInfo); |
524 |
} |
525 |
|
526 |
/*
|
527 |
* (non-Javadoc)
|
528 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#saveColorTableToRmf(org.gvsig.fmap.dal.coverage.store.props.ColorTable)
|
529 |
*/
|
530 |
public abstract void saveColorTableToRmf(ColorTable table) throws RmfSerializerException; |
531 |
|
532 |
|
533 |
/**
|
534 |
* Saves information about serials
|
535 |
* @param object to save
|
536 |
* @throws RmfSerializerException
|
537 |
*/
|
538 |
public abstract void saveSerialInfoToRmf(SerialInfo serialInfo) throws RmfSerializerException; |
539 |
|
540 |
/**
|
541 |
* Loads information about serials
|
542 |
* @param object to load
|
543 |
* @throws RmfSerializerException
|
544 |
*/
|
545 |
public abstract boolean loadSerialInfoFromRmf(SerialInfo serialInfo); |
546 |
|
547 |
/*
|
548 |
* (non-Javadoc)
|
549 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#createVectorizeObject(org.gvsig.fmap.dal.coverage.store.RasterDataStore)
|
550 |
*/
|
551 |
public Vectorization createVectorizeObject() throws RasterDriverException, ProcessInterruptedException { |
552 |
return new PotraceVectorization((RasterDataStore)this); |
553 |
} |
554 |
|
555 |
/*
|
556 |
* (non-Javadoc)
|
557 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getRender()
|
558 |
*/
|
559 |
public Render getRender() {
|
560 |
if(render == null) |
561 |
render = new DefaultRender(this); |
562 |
return render;
|
563 |
} |
564 |
|
565 |
/*
|
566 |
* (non-Javadoc)
|
567 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getRender()
|
568 |
*/
|
569 |
public void setRender(Render render) { |
570 |
this.render = render;
|
571 |
} |
572 |
|
573 |
/**
|
574 |
* Obtiene la altura de la fuente de datos.
|
575 |
* @return altura en celdas del grid.
|
576 |
*/
|
577 |
private int getSourceHeight() { |
578 |
return (int)getHeight(); |
579 |
} |
580 |
|
581 |
/**
|
582 |
* Obtiene la anchura de la fuente de datos.
|
583 |
* @return anchura en celdas del grid.
|
584 |
*/
|
585 |
private int getSourceWidth() { |
586 |
return (int)getWidth(); |
587 |
} |
588 |
|
589 |
/*
|
590 |
* (non-Javadoc)
|
591 |
* @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#isFileSupported(java.lang.String)
|
592 |
*/
|
593 |
public boolean isFileSupported(String fName) { |
594 |
ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager(); |
595 |
ExtensionPoint point = extensionPoints.get("RasterReader");
|
596 |
return point.has(RasterLocator.getManager().getFileUtils().getExtensionFromFileName(fName));
|
597 |
} |
598 |
|
599 |
/**
|
600 |
* Registers metadata definition
|
601 |
* @throws MetadataException
|
602 |
*/
|
603 |
public static void registerMetadataDefinition() throws MetadataException { |
604 |
MetadataManager manager = MetadataLocator.getMetadataManager(); |
605 |
|
606 |
if(manager == null) |
607 |
return;
|
608 |
|
609 |
if( manager.getDefinition(METADATA_DEFINITION_NAME) == null ) { |
610 |
DynStruct defnition = manager.addDefinition( |
611 |
METADATA_DEFINITION_NAME, |
612 |
METADATA_DEFINITION_NAME |
613 |
); |
614 |
defnition.extend( |
615 |
MetadataManager.METADATA_NAMESPACE, |
616 |
DataStore.METADATA_DEFINITION_NAME |
617 |
); |
618 |
} |
619 |
} |
620 |
|
621 |
//****************************************************
|
622 |
//****Implementing DataStoreImplementation methods****
|
623 |
//****************************************************
|
624 |
|
625 |
/*
|
626 |
* (non-Javadoc)
|
627 |
* @see org.gvsig.fmap.dal.impl.DataStoreImplementation#intializePhase1(org.gvsig.fmap.dal.impl.DefaultDataManager, org.gvsig.fmap.dal.DataStoreParameters)
|
628 |
*/
|
629 |
public void intializePhase1(DefaultDataManager dataManager, |
630 |
DataStoreParameters parameters) throws InitializeException {
|
631 |
DynObjectManager dynManager = ToolsLocator.getDynObjectManager(); |
632 |
|
633 |
this.metadata = (DelegatedDynObject) dynManager
|
634 |
.createDynObject( |
635 |
MetadataLocator.getMetadataManager().getDefinition(DataStore.SPATIAL_METADATA_DEFINITION_NAME) |
636 |
); |
637 |
this.dataManager = dataManager;
|
638 |
this.parameters = parameters;
|
639 |
|
640 |
} |
641 |
|
642 |
/*
|
643 |
* (non-Javadoc)
|
644 |
* @see org.gvsig.fmap.dal.impl.DataStoreImplementation#intializePhase2(org.gvsig.fmap.dal.spi.DataStoreProvider)
|
645 |
*/
|
646 |
public void intializePhase2(DataStoreProvider provider) |
647 |
throws InitializeException {
|
648 |
} |
649 |
|
650 |
/* (non-Javadoc)
|
651 |
* @see org.gvsig.fmap.dal.raster.spi.CoverageStoreProviderServices#getManager()
|
652 |
*/
|
653 |
public DefaultDataManager getManager() {
|
654 |
return this.dataManager; |
655 |
} |
656 |
|
657 |
//****************************************************
|
658 |
//*********Implementing DataStore methods*************
|
659 |
//****************************************************
|
660 |
|
661 |
/*
|
662 |
* (non-Javadoc)
|
663 |
* @see org.gvsig.fmap.dal.DataStore#getProviderName()
|
664 |
*/
|
665 |
public String getProviderName() { |
666 |
return null; |
667 |
} |
668 |
|
669 |
/*
|
670 |
* (non-Javadoc)
|
671 |
* @see org.gvsig.fmap.dal.DataStore#refresh()
|
672 |
*/
|
673 |
public void refresh() throws DataException { |
674 |
return;
|
675 |
} |
676 |
|
677 |
/*
|
678 |
* (non-Javadoc)
|
679 |
* @see org.gvsig.fmap.dal.DataStore#getDataSet()
|
680 |
*/
|
681 |
public DataSet getDataSet() throws DataException { |
682 |
return null; |
683 |
} |
684 |
|
685 |
/*
|
686 |
* (non-Javadoc)
|
687 |
* @see org.gvsig.fmap.dal.DataStore#getDataSet(org.gvsig.fmap.dal.DataQuery)
|
688 |
*/
|
689 |
public DataSet getDataSet(DataQuery dataQuery) throws DataException { |
690 |
return null; |
691 |
} |
692 |
|
693 |
/*
|
694 |
* (non-Javadoc)
|
695 |
* @see org.gvsig.fmap.dal.DataStore#accept(org.gvsig.tools.visitor.Visitor, org.gvsig.fmap.dal.DataQuery)
|
696 |
*/
|
697 |
public void accept(Visitor visitor, DataQuery dataQuery) |
698 |
throws BaseException {
|
699 |
} |
700 |
|
701 |
/*
|
702 |
* (non-Javadoc)
|
703 |
* @see org.gvsig.fmap.dal.DataStore#getDataSet(org.gvsig.tools.observer.Observer)
|
704 |
*/
|
705 |
public void getDataSet(org.gvsig.tools.observer.Observer observer) throws DataException { |
706 |
} |
707 |
|
708 |
/*
|
709 |
* (non-Javadoc)
|
710 |
* @see org.gvsig.fmap.dal.DataStore#getDataSet(org.gvsig.fmap.dal.DataQuery, org.gvsig.tools.observer.Observer)
|
711 |
*/
|
712 |
public void getDataSet(DataQuery dataQuery, org.gvsig.tools.observer.Observer observer) throws DataException { |
713 |
} |
714 |
|
715 |
/*
|
716 |
* (non-Javadoc)
|
717 |
* @see org.gvsig.fmap.dal.DataStore#getSelection()
|
718 |
*/
|
719 |
public DataSet getSelection() throws DataException { |
720 |
return null; |
721 |
} |
722 |
|
723 |
/*
|
724 |
* (non-Javadoc)
|
725 |
* @see org.gvsig.fmap.dal.DataStore#setSelection(org.gvsig.fmap.dal.DataSet)
|
726 |
*/
|
727 |
public void setSelection(DataSet selection) throws DataException { |
728 |
} |
729 |
|
730 |
/*
|
731 |
* (non-Javadoc)
|
732 |
* @see org.gvsig.fmap.dal.DataStore#createSelection()
|
733 |
*/
|
734 |
public DataSet createSelection() throws DataException { |
735 |
return null; |
736 |
} |
737 |
|
738 |
/*
|
739 |
* (non-Javadoc)
|
740 |
* @see org.gvsig.fmap.dal.DataStore#getChildren()
|
741 |
*/
|
742 |
@SuppressWarnings("unchecked") |
743 |
public Iterator getChildren() { |
744 |
return null; |
745 |
} |
746 |
|
747 |
/*
|
748 |
* (non-Javadoc)
|
749 |
* @see org.gvsig.fmap.dal.DataStore#getExplorer()
|
750 |
*/
|
751 |
public DataServerExplorer getExplorer() throws DataException, ValidateDataParametersException { |
752 |
return null; |
753 |
} |
754 |
|
755 |
/*
|
756 |
* (non-Javadoc)
|
757 |
* @see org.gvsig.fmap.dal.DataStore#createQuery()
|
758 |
*/
|
759 |
public DataQuery createQuery() {
|
760 |
return new DefaultRasterQuery(); |
761 |
} |
762 |
|
763 |
//****************************************************
|
764 |
//*********Implementing Persistent methods*************
|
765 |
//****************************************************
|
766 |
|
767 |
/*
|
768 |
* (non-Javadoc)
|
769 |
* @see org.gvsig.tools.persistence.Persistent#saveToState(org.gvsig.tools.persistence.PersistentState)
|
770 |
*/
|
771 |
public void saveToState(PersistentState state) throws PersistenceException { |
772 |
|
773 |
} |
774 |
|
775 |
/*
|
776 |
* (non-Javadoc)
|
777 |
* @see org.gvsig.tools.persistence.Persistent#loadFromState(org.gvsig.tools.persistence.PersistentState)
|
778 |
*/
|
779 |
public void loadFromState(PersistentState state) throws PersistenceException { |
780 |
|
781 |
} |
782 |
|
783 |
//****************************************************
|
784 |
//*********Implementing Metadata methods*************
|
785 |
//****************************************************
|
786 |
|
787 |
/*
|
788 |
* (non-Javadoc)
|
789 |
* @see org.gvsig.metadata.Metadata#getMetadataID()
|
790 |
*/
|
791 |
public Object getMetadataID() { |
792 |
if(parameters != null && parameters instanceof RasterFileStoreParameters) |
793 |
return ((RasterFileStoreParameters)parameters).getFile();
|
794 |
if(parameters != null && parameters instanceof RasterDataParameters) |
795 |
return ((RasterDataParameters)parameters).getURI();
|
796 |
return null; |
797 |
} |
798 |
|
799 |
/*
|
800 |
* (non-Javadoc)
|
801 |
* @see org.gvsig.metadata.Metadata#getMetadataChildren()
|
802 |
*/
|
803 |
@SuppressWarnings("unchecked") |
804 |
public Set getMetadataChildren() { |
805 |
return null; |
806 |
} |
807 |
|
808 |
//****************************************************
|
809 |
//*********Implementing Disposable methods************
|
810 |
//****************************************************
|
811 |
|
812 |
/*
|
813 |
* (non-Javadoc)
|
814 |
* @see org.gvsig.tools.dispose.impl.AbstractDisposable#doDispose()
|
815 |
*/
|
816 |
public void doDispose() { |
817 |
|
818 |
} |
819 |
|
820 |
//****************************************************
|
821 |
//*********Implementing Visitable methods*************
|
822 |
//****************************************************
|
823 |
|
824 |
/*
|
825 |
* (non-Javadoc)
|
826 |
* @see org.gvsig.tools.visitor.Visitable#accept(org.gvsig.tools.visitor.Visitor)
|
827 |
*/
|
828 |
public void accept(Visitor visitor) throws BaseException { |
829 |
|
830 |
} |
831 |
|
832 |
//****************************************************
|
833 |
//****Implementing ComplexObservable methods**********
|
834 |
//****************************************************
|
835 |
|
836 |
/*
|
837 |
* (non-Javadoc)
|
838 |
* @see org.gvsig.tools.observer.ComplexObservable#disableNotifications()
|
839 |
*/
|
840 |
public void disableNotifications() { |
841 |
|
842 |
} |
843 |
|
844 |
/*
|
845 |
* (non-Javadoc)
|
846 |
* @see org.gvsig.tools.observer.ComplexObservable#enableNotifications()
|
847 |
*/
|
848 |
public void enableNotifications() { |
849 |
|
850 |
} |
851 |
|
852 |
/*
|
853 |
* (non-Javadoc)
|
854 |
* @see org.gvsig.tools.observer.ComplexObservable#beginComplexNotification()
|
855 |
*/
|
856 |
public void beginComplexNotification() { |
857 |
|
858 |
} |
859 |
|
860 |
/*
|
861 |
* (non-Javadoc)
|
862 |
* @see org.gvsig.tools.observer.ComplexObservable#endComplexNotification()
|
863 |
*/
|
864 |
public void endComplexNotification() { |
865 |
|
866 |
} |
867 |
|
868 |
//****************************************************
|
869 |
//********Implementing Observable methods*************
|
870 |
//****************************************************
|
871 |
|
872 |
/*
|
873 |
* (non-Javadoc)
|
874 |
* @see org.gvsig.tools.observer.Observable#addObserver(org.gvsig.tools.observer.Observer)
|
875 |
*/
|
876 |
public void addObserver(org.gvsig.tools.observer.Observer o) { |
877 |
|
878 |
} |
879 |
|
880 |
/*
|
881 |
* (non-Javadoc)
|
882 |
* @see org.gvsig.tools.observer.Observable#deleteObserver(org.gvsig.tools.observer.Observer)
|
883 |
*/
|
884 |
public void deleteObserver(org.gvsig.tools.observer.Observer o) { |
885 |
|
886 |
} |
887 |
|
888 |
/*
|
889 |
* (non-Javadoc)
|
890 |
* @see org.gvsig.tools.observer.Observable#deleteObservers()
|
891 |
*/
|
892 |
public void deleteObservers() { |
893 |
|
894 |
} |
895 |
|
896 |
//****************************************************
|
897 |
//********Implementing DynObject methods*************
|
898 |
//****************************************************
|
899 |
|
900 |
/*
|
901 |
* (non-Javadoc)
|
902 |
* @see org.gvsig.tools.dynobject.DynObject#getDynClass()
|
903 |
*/
|
904 |
public DynClass getDynClass() {
|
905 |
return this.metadata.getDynClass(); |
906 |
} |
907 |
|
908 |
/*
|
909 |
* (non-Javadoc)
|
910 |
* @see org.gvsig.tools.dynobject.DynObject#implement(org.gvsig.tools.dynobject.DynClass)
|
911 |
*/
|
912 |
public void implement(DynClass dynClass) { |
913 |
this.metadata.implement(dynClass);
|
914 |
} |
915 |
|
916 |
/*
|
917 |
* (non-Javadoc)
|
918 |
* @see org.gvsig.tools.dynobject.DynObject#delegate(org.gvsig.tools.dynobject.DynObject)
|
919 |
*/
|
920 |
public void delegate(DynObject dynObject) { |
921 |
this.metadata.delegate(dynObject);
|
922 |
} |
923 |
|
924 |
/*
|
925 |
* (non-Javadoc)
|
926 |
* @see org.gvsig.tools.dynobject.DynObject#getDynValue(java.lang.String)
|
927 |
*/
|
928 |
public Object getDynValue(String name) throws DynFieldNotFoundException { |
929 |
return this.metadata.getDynValue(name); |
930 |
} |
931 |
|
932 |
/*
|
933 |
* (non-Javadoc)
|
934 |
* @see org.gvsig.tools.dynobject.DynObject#setDynValue(java.lang.String, java.lang.Object)
|
935 |
*/
|
936 |
public void setDynValue(String name, Object value) throws DynFieldNotFoundException { |
937 |
this.metadata.setDynValue(name, value);
|
938 |
} |
939 |
|
940 |
/*
|
941 |
* (non-Javadoc)
|
942 |
* @see org.gvsig.tools.dynobject.DynObject#hasDynValue(java.lang.String)
|
943 |
*/
|
944 |
public boolean hasDynValue(String name) { |
945 |
return this.metadata.hasDynValue(name); |
946 |
} |
947 |
|
948 |
/*
|
949 |
* (non-Javadoc)
|
950 |
* @see org.gvsig.tools.dynobject.DynObject#invokeDynMethod(java.lang.String, org.gvsig.tools.dynobject.DynObject)
|
951 |
*/
|
952 |
public Object invokeDynMethod(String name, DynObject context) throws DynMethodException { |
953 |
return this.metadata.invokeDynMethod(this, name, context); |
954 |
} |
955 |
|
956 |
/*
|
957 |
* (non-Javadoc)
|
958 |
* @see org.gvsig.tools.dynobject.DynObject#invokeDynMethod(int, org.gvsig.tools.dynobject.DynObject)
|
959 |
*/
|
960 |
public Object invokeDynMethod(int code, DynObject context) throws DynMethodException { |
961 |
return this.metadata.invokeDynMethod(this, code, context); |
962 |
} |
963 |
|
964 |
/*
|
965 |
* (non-Javadoc)
|
966 |
* @see org.gvsig.tools.dynobject.DynObject#clear()
|
967 |
*/
|
968 |
public void clear() { |
969 |
if (metadata != null) { |
970 |
metadata.clear(); |
971 |
} |
972 |
} |
973 |
|
974 |
/*
|
975 |
* (non-Javadoc)
|
976 |
* @see org.gvsig.fmap.dal.DataStore#getParameters()
|
977 |
*/
|
978 |
public DataStoreParameters getParameters() {
|
979 |
return parameters;
|
980 |
} |
981 |
|
982 |
//***********************************************************************
|
983 |
//********Implementing CoverageStoreProviderServices methods*************
|
984 |
//***********************************************************************
|
985 |
|
986 |
public CoverageSelection createDefaultCoverageSelection()
|
987 |
throws DataException {
|
988 |
return null; |
989 |
} |
990 |
|
991 |
/*
|
992 |
* (non-Javadoc)
|
993 |
* @see org.gvsig.fmap.dal.raster.spi.CoverageStoreProviderServices#getCoverageStore()
|
994 |
*/
|
995 |
public CoverageStore getCoverageStore() {
|
996 |
return this; |
997 |
} |
998 |
|
999 |
/*
|
1000 |
* (non-Javadoc)
|
1001 |
* @see org.gvsig.fmap.dal.raster.spi.CoverageStoreProviderServices#getProvider()
|
1002 |
*/
|
1003 |
public abstract CoverageStoreProvider getProvider(); |
1004 |
|
1005 |
/*
|
1006 |
* (non-Javadoc)
|
1007 |
* @see org.gvsig.fmap.dal.raster.spi.CoverageStoreProviderServices#notifyChange(java.lang.String)
|
1008 |
*/
|
1009 |
public void notifyChange(String notification) { |
1010 |
delegateObservable |
1011 |
.notifyObservers(new DefaultCoverageStoreNotification(
|
1012 |
this, notification));
|
1013 |
} |
1014 |
|
1015 |
/*
|
1016 |
* (non-Javadoc)
|
1017 |
* @see org.gvsig.fmap.dal.raster.spi.CoverageStoreProviderServices#notifyChange(java.lang.String, org.gvsig.fmap.dal.resource.Resource)
|
1018 |
*/
|
1019 |
public void notifyChange(String arg0, Resource arg1) { |
1020 |
delegateObservable.notifyObservers(new DefaultFeatureStoreNotification(
|
1021 |
this, FeatureStoreNotification.RESOURCE_CHANGED));
|
1022 |
} |
1023 |
|
1024 |
/*
|
1025 |
* (non-Javadoc)
|
1026 |
* @see org.gvsig.fmap.dal.raster.spi.CoverageStoreProviderServices#notifyChange(java.lang.String, org.gvsig.tools.undo.command.Command)
|
1027 |
*/
|
1028 |
public void notifyChange(String notification, Command command) { |
1029 |
delegateObservable |
1030 |
.notifyObservers(new DefaultCoverageStoreNotification(
|
1031 |
this, notification, command));
|
1032 |
} |
1033 |
|
1034 |
/*
|
1035 |
* (non-Javadoc)
|
1036 |
* @see org.gvsig.fmap.dal.spi.DataStoreProviderServices#getStore()
|
1037 |
*/
|
1038 |
public DataStore getStore() {
|
1039 |
return this; |
1040 |
} |
1041 |
} |