Revision 1862

View differences:

org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterManager.java
30 30
import org.gvsig.fmap.dal.coverage.dataset.Buffer;
31 31
import org.gvsig.fmap.dal.coverage.datastruct.DataStructFactory;
32 32
import org.gvsig.fmap.dal.coverage.datastruct.Extent;
33
import org.gvsig.fmap.dal.coverage.datastruct.GridExtent;
34 33
import org.gvsig.fmap.dal.coverage.datastruct.Params;
35 34
import org.gvsig.fmap.dal.coverage.datastruct.RasterLegend;
36 35
import org.gvsig.fmap.dal.coverage.datastruct.ViewPortData;
37 36
import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
38
import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidException;
39 37
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
40 38
import org.gvsig.fmap.dal.coverage.exception.RasterLegendIONotFound;
41 39
import org.gvsig.fmap.dal.coverage.grid.AbstractROI;
......
48 46
import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
49 47
import org.gvsig.fmap.dal.coverage.store.RasterQuery;
50 48
import org.gvsig.fmap.dal.coverage.store.RasterWriter;
49
import org.gvsig.fmap.dal.coverage.store.parameter.NewRasterStoreParameters;
51 50
import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
52 51
import org.gvsig.fmap.dal.coverage.store.props.Statistics;
53 52
import org.gvsig.fmap.dal.coverage.util.CRSUtils;
......
58 57
import org.gvsig.fmap.dal.coverage.util.ProviderServices;
59 58
import org.gvsig.fmap.dal.coverage.util.RasterUtils;
60 59
import org.gvsig.fmap.dal.raster.spi.CoverageStoreProvider;
61
import org.gvsig.tools.service.ServiceException;
62 60

  
63 61
/**
64 62
 * This class is responsible of the management of the library's business logic.
......
73 71
	public int TYPE_MULTIDATA   = 0;
74 72
	public int TYPE_MOSAICDATA  = 1;
75 73
	
74
	/* **************************
75
	 *        SERVICES
76
	 ************************** */
77
	
76 78
	/**
77 79
	 * Gets the factory to build buffers which store pixel data
78 80
	 * @return {@link BufferFactory}
......
86 88
	public DataStructFactory getDataStructFactory();
87 89
	
88 90
	/**
89
	 * Gets the Provider information object
91
	 * Gets the data source services
90 92
	 * @return
91 93
	 */
92 94
	public ProviderServices getProviderServices();
93 95
	
94 96
	/**
95
	 * Gets the CRS utilities
97
	 * Gets projection utilities 
96 98
	 * @return
97 99
	 */
98 100
	public CRSUtils getCRSUtils();
99 101
	
100 102
	/**
101
	 * Gets the file utilities
103
	 * Gets utilities for files management
102 104
	 * @return
103 105
	 */
104 106
	public FileUtils getFileUtils();
105 107
	
106 108
	/**
107
	 * Gets the raster utilities
109
	 * Gets utilities for raster management
108 110
	 * @return
109 111
	 */
110 112
	public RasterUtils getRasterUtils();
111 113
	
112 114
	/**
113
	 * Gets the mathematical utilities
115
	 * Gets mathematical utilities
114 116
	 * @return
115 117
	 */
116 118
	public MathUtils getMathUtils();
117
	
118
    /**
119
     * Create an instance of a {@link RasterService}.
120
     * 
121
     * @return {@link RasterService}
122
     * @throws ServiceException
123
     *             if there is an error getting the service
124
     */
125
    public RasterService getRasterService() throws ServiceException;
126 119
    
127 120
    /**
128 121
     * Gets the object to convert color spaces
......
131 124
    public ColorConversion getColorConversion();
132 125
    
133 126
	/**
127
	 * Builds a new empty RasterQuery object
128
	 * @return {@link RasterQuery}
129
	 */
130
	public RasterQuery createQuery();
131
	
132
	/**
133
	 * Gets an instance of the overview builder registered
134
	 * @return OverviewBuilder
135
	 */
136
	public OverviewBuilder createOverviewBuilder();
137
	
138
    /**
139
     * Builds a new service to recover historical objects 
140
     * @return
141
     */
142
    public Historical createHistoricalService();
143
    
144
	/**
145
	 * Returns a Statistics object for a ROI
146
	 * @param roi
147
	 * @return
148
	 */
149
	public Statistics createROIStatistics(AbstractROI roi);
150
	
151
	/**
152
	 * Creates a service to render a buffer on a java Image object
153
	 * @return
154
	 */
155
	public ImageDrawer createImageDrawerService();
156
	
157
	/* **************************
158
	 *        LEGENDS
159
	 ************************** */
160
	
161
	/**
134 162
	 * Lista de formatos soportados por RasterLegendIO
135 163
	 *
136 164
	 * @return
......
145 173
	 * @throws RasterLegendIONotFound
146 174
	 */
147 175
	public RasterLegend getRasterLegendIO(String formatName) throws RasterLegendIONotFound;
148

  
176
	
177
	
178
	/* **************************
179
	 *        TASK
180
	 ************************** */
181
	
149 182
	/**
183
	 * Gets a register task. To get a task it will use the current thread ID
184
	 * @return TaskEventManager
185
	 */
186
	public TaskEventManager getRasterTask();
187
	
188
	/**
189
	 * Registers the object as a task using the current thread ID. It returns
190
	 * a TaskEventManager
191
	 * @param process
192
	 * @return
193
	 */
194
	public TaskEventManager createRasterTask(Object process);
195
	
196
	/* **************************
197
	 *        FILTER
198
	 ************************** */
199
	
200
	/**
201
	 * Builds a new and empty filter list
202
	 * @return
203
	 */
204
	public RasterFilterList createEmptyFilterList(int type);
205
	
206
	/**
207
	 * Builds a new parameter object. These parameters represents the fieds of a filter
208
	 * panel.
209
	 * @param id
210
	 * @param value
211
	 * @param type 
212
	 * @param list
213
	 * @return
214
	 */
215
	public Params createParams(String id, Object value, int type, String[] list);
216
	
217
	/* **************************
218
	 *      DEPRECATED
219
	 ************************** */
220
	
221
	 /**
222
     * Builds a new ViewPortData object
223
     * @param proj
224
     * @param extent
225
     * @param size
226
     * @return
227
     * @deprecated Use <code>DataStructFactory</code> with getDataStructFactory
228
     */
229
    public ViewPortData createViewPortData(IProjection proj, Extent extent, Dimension2D size);
230
    
231
    /**
232
     * Builds a new ViewPortData object
233
     * @return
234
     * @deprecated Use <code>DataStructFactory</code> with getDataStructFactory
235
     */
236
    public ViewPortData createViewPortData();
237
	
238
	/**
239
	 * Gets a new instance of a ColorInterpretation object
240
	 * @param A list of color interpretation strings
241
	 * @return
242
	 * @deprecated Use <code>DataStructFactory</code> with getDataStructFactory
243
	 */
244
	public ColorInterpretation createColorInterpretation(String[] colorInterp);
245
	
246
	/**
150 247
	 * Abre un dataset pasando como par?metros la proyecci?n y un objeto identificador del dataset. Este
151 248
	 * objeto puede ser una ruta a un fichero en disco. En este caso la extensi?n del fichero servir? para
152 249
	 * buscar el driver que lo gestiona. Si proporcionamos un array de cadenas se tratar?n como la ruta a N ficheros
......
156 253
	 * @return RasterMultiDatset
157 254
	 * @throws NotSupportedExtensionException
158 255
	 * @throws RasterDriverException
256
	 * @deprecated Use <code>ProviderServices</code> with getProviderServices
159 257
	 */
160 258
	public RasterDataStore open(DataStoreParameters param) throws NotSupportedExtensionException, RasterDriverException;
161 259
	
260
	/**
261
	 * @deprecated Use <code>ProviderServices</code> with getProviderServices
262
	 * @param prov
263
	 * @param params
264
	 * @return
265
	 * @throws NotSupportedExtensionException
266
	 * @throws RasterDriverException
267
	 */
162 268
	public RasterDataStore open(CoverageStoreProvider prov, DataStoreParameters params) throws NotSupportedExtensionException, RasterDriverException;
163 269
	
270
	
164 271
	/**
165
	 * Builds a new empty RasterQuery object
166
	 * @return {@link RasterQuery}
272
	 * Registers raster providers that support tiles. This method is only for providers. 
273
	 * In a far future it will be in the SPI.
274
	 * @param provider
275
	 * @deprecated Use <code>ProviderServices</code> with getProviderServices
167 276
	 */
168
	public RasterQuery createQuery();
277
	public void registerFileProvidersTiled(Class<?> provider);
278
		
279
	/**
280
	 * Gets the list of raster providers that support tiles. This method is only for providers. 
281
	 * In a far future it will be in the SPI.
282
	 * @return
283
	 * @deprecated Use <code>ProviderServices</code> with getProviderServices
284
	 */
285
	public void registerTileProviderFormats(Class<?> c);
169 286
	
170 287
	/**
288
	 * Register a format and a provider which is capable to manage this format
289
	 * @param ext Extension
290
	 * @param c Provider class
291
	 * @deprecated Use <code>ProviderServices</code> with getProviderServices
292
	 */
293
	public void addFormat(String ext, Class<?> c);
294
	
295
	/**
296
	 * Returns true if the extension is supported and false if doesn't
297
	 * @param ext
298
	 * @return
299
	 * @deprecated Use <code>ProviderServices</code> with getProviderServices
300
	 */
301
	public boolean isExtensionSupported(String ext, Class<?> c);
302
	
303
	/**
304
	 * Returns true if the extension is supported and false if doesn't
305
	 * @param ext
306
	 * @return
307
	 * @deprecated Use <code>ProviderServices</code> with getProviderServices
308
	 */
309
	public boolean isExtensionSupported(String ext);
310
	
311
	/**
312
	 * Returns the list of supported formats in read only mode
313
	 * @return
314
	 * @deprecated Use <code>ProviderServices</code> with getProviderServices
315
	 */
316
	public String[] getReadOnlyFormatList();
317
	
318
	/**
171 319
	 * Genera instancias del buffer de datos adecuado al tama?o del raster. Si no hay muchos datos
172 320
	 * (menos de cacheMemorySize) crear? un buffer en memoria. Si hay m?s de esta cantidad
173 321
	 * entonces crearemos un buffer cacheado (RasterCache). A partir de la cantidad se?alada
......
267 415
	public DataServerWriter createDataServerWriter();
268 416
	
269 417
	/**
270
	 * Gets an instance of the overview builder registered
271
	 * @return OverviewBuilder
272
	 */
273
	public OverviewBuilder createOverviewBuilder();
274
	
275
	/**
276
	 * Gets a new instance of a ColorInterpretation object
277
	 * @param A list of color interpretation strings
278
	 * @return
279
	 */
280
	public ColorInterpretation createColorInterpretation(String[] colorInterp);
281
	
282
	/**
283
	 * Crea un grid a partir de un MultiRasterDataset. Usa el extent de la fuente de datos como
284
	 * extent completo y el extent pasado como par?metro como extensi?n de ventana.
285
	 *
286
	 * Cuando se construye el reader se carga el buffer con la extensi?n definida en windowExtent
287
	 * y las bandas especificadas en bands.
288
	 *
289
	 * @param IRasterDataSource datasets que proporcionan los datos
290
	 * @param bands n?mero de bandas requeridas
291
	 * @param windowExtent Extensi?n de la ventana. Si este par?metro es null se usar? el
292
	 * mismo que el de la capa.
293
	 */
294
	public Grid createGrid(RasterDataStore datasource, int[] bands, GridExtent windowExtent) throws RasterBufferInvalidException;
295
	
296
	/**
297
	 * Crea un grid a partir de un BufferFactory. Se har? una petici?n del extent completo de la fuente.
298
	 * bufferFactory tiene asociada una fuente de datos pero se ignorar? si tiene el buffer lleno. La instanciaci?n
299
	 * de GridNotInterpolated har? que se haga la petici?n para cargar raster completo.
300
	 * @param bufferFactory Fuente de datos
301
	 * @param bands n?mero de bandas requeridas y orden de dibujado en el buffer
302
	 */
303
	public Grid createGrid(RasterDataStore datasource, int[] bands) throws RasterBufferInvalidException;
304
	
305
	/**
306
	 * Crea un grid a partir de un BufferFactory. Se har? una petici?n del extent completo de la fuente.
307
	 * bufferFactory tiene asociada una fuente de datos pero se ignorar? si tiene el buffer lleno. La instanciaci?n
308
	 * de GridNotInterpolated har? que se haga la petici?n para cargar raster completo. El buffer se cargar?
309
	 * con todas las bandas disponibles.
310
	 * @param datasource Fuente de datos
311
	 */
312
	public Grid createGrid(RasterDataStore datasource) throws RasterBufferInvalidException;
313
	
314
	/**
315
	 * Crea un grid vacio a partir de un extent y un tipo de datos. Se crea un buffer vacio en el
316
	 * que puede escribirse a trav?s del writer. Los datos escritos pueden ser consultados con el
317
	 * reader. No tiene una fuente de datos asociada ya que es un grid vacio basicamente para
318
	 * escritura.
319
	 * @param layerExtent Tama?o completo de la capa
320
	 * @param windowExtent Ventana de datos.
321
	 * @param dataType Tipo de datos del buffer
322
	 * @param bands n?mero de bandas requeridas y orden de dibujado en el buffer
323
	 */
324
	public Grid createGrid(GridExtent layerExtent,
325
			GridExtent windowExtent,
326
			int dataType,
327
			int[] bands) throws RasterBufferInvalidException;
328
	
329
	/**
330 418
	 * Crea un grid a partir de un BufferFactory. El buffer debe estar cargado de datos y el extent
331 419
	 * de este viene definido en el par?metro windowExtent.
332 420
	 * @param bufferFactory Fuente de datos
333 421
	 * @param windowExtent	Extent de los datos cargados en bufferFactory
334 422
	 * @param notInterp Si es true fuerza a que el reader sea sin interpolaci?n. Si es false decide si
335 423
	 * el reader es interpolado o no a partir de los extents de capa y la ventana seleccionada.
424
	 * @deprecated Don't use a <code>Grid</code>. It will be removed soon
336 425
	 */
337 426
	public Grid createGrid(Buffer buf, RasterDataStore datasource, boolean notInterp);
338
	
339
    /**
340
     * Builds a new service to recover historical objects 
341
     * @return
342
     */
343
    public Historical createHistoricalService();
344
    
345
    /**
346
     * Builds a new ViewPortData object
347
     * @param proj
348
     * @param extent
349
     * @param size
350
     * @return
351
     */
352
    public ViewPortData createViewPortData(IProjection proj, Extent extent, Dimension2D size);
353
    
354
    /**
355
     * Builds a new ViewPortData object
356
     * @return
357
     */
358
    public ViewPortData createViewPortData();
359
    
360
	/**
361
	 * Returns a Statistics object for a ROI
362
	 * @param roi
363
	 * @return
364
	 */
365
	public Statistics createROIStatistics(AbstractROI roi);
366
	
367
	/**
368
	 * Builds a new and empty filter list
369
	 * @return
370
	 */
371
	public RasterFilterList createEmptyFilterList(int type);
372
	
373
	/**
374
	 * Gets a register task. To get a task it will use the current thread ID
375
	 * @return TaskEventManager
376
	 */
377
	public TaskEventManager getRasterTask();
378
	
379
	/**
380
	 * Registers the object as a task using the current thread ID. It returns
381
	 * a TaskEventManager
382
	 * @param process
383
	 * @return
384
	 */
385
	public TaskEventManager createRasterTask(Object process);
386
	
387
	/**
388
	 * Builds a new parameter object. These parameters represents the fieds of a filter
389
	 * panel.
390
	 * @param id
391
	 * @param value
392
	 * @param type 
393
	 * @param list
394
	 * @return
395
	 */
396
	public Params createParams(String id, Object value, int type, String[] list);
397
	
398
	/**
399
	 * Registers raster providers that support tiles. This method is only for providers. 
400
	 * In a far future it will be in the SPI.
401
	 * @param provider
402
	 */
403
	public void registerFileProvidersTiled(Class<?> provider);
404
		
405
	/**
406
	 * Gets the list of raster providers that support tiles. This method is only for providers. 
407
	 * In a far future it will be in the SPI.
408
	 * @return
409
	 */
410
	public void registerTileProviderFormats(Class<?> c);
411
	
412
	/**
413
	 * Register a format and a provider which is capable to manage this format
414
	 * @param ext Extension
415
	 * @param c Provider class
416
	 */
417
	public void addFormat(String ext, Class<?> c);
418
	
419
	/**
420
	 * Returns true if the extension is supported and false if doesn't
421
	 * @param ext
422
	 * @return
423
	 */
424
	public boolean isExtensionSupported(String ext, Class<?> c);
425
	
426
	/**
427
	 * Returns true if the extension is supported and false if doesn't
428
	 * @param ext
429
	 * @return
430
	 */
431
	public boolean isExtensionSupported(String ext);
432
	
433
	/**
434
	 * Returns the list of supported formats in read only mode
435
	 * @return
436
	 */
437
	public String[] getReadOnlyFormatList();
438
	
439
	/**
440
	 * Creates a service to render a buffer on a java Image object
441
	 * @return
442
	 */
443
	public ImageDrawer createImageDrawerService();
444 427
}
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/ProviderServices.java
25 25
import java.io.IOException;
26 26
import java.util.ArrayList;
27 27

  
28
import org.gvsig.fmap.dal.DataStoreParameters;
28 29
import org.gvsig.fmap.dal.coverage.dataset.Buffer;
29 30
import org.gvsig.fmap.dal.coverage.datastruct.Extent;
30 31
import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
31 32
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
32 33
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
33 34
import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
35
import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
34 36
import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
35 37
import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
36 38
import org.gvsig.fmap.dal.exception.InitializeException;
37 39
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
40
import org.gvsig.fmap.dal.raster.spi.CoverageStoreProvider;
38 41

  
39 42

  
40 43
/**
41
 * Providers information
44
 * Providers information and basic operations
42 45
 * @author Nacho Brodin nachobrodin@gmail.com
43 46
 */
44 47
public interface ProviderServices {
45 48
	
46 49
	/**
50
	 * Abre un dataset pasando como par?metros la proyecci?n y un objeto identificador del dataset. Este
51
	 * objeto puede ser una ruta a un fichero en disco. En este caso la extensi?n del fichero servir? para
52
	 * buscar el driver que lo gestiona. Si proporcionamos un array de cadenas se tratar?n como la ruta a N ficheros
53
	 * de disco. Tambi?n puede ser un buffer de datos en memoria o cualquier otro objeto
54
	 * que pueda aceptar un driver.
55
	 * @param param Par?metros al driver
56
	 * @return RasterMultiDatset
57
	 * @throws NotSupportedExtensionException
58
	 * @throws RasterDriverException
59
	 */
60
	public RasterDataStore open(DataStoreParameters param) throws NotSupportedExtensionException, RasterDriverException;
61
	
62
	public RasterDataStore open(CoverageStoreProvider prov, DataStoreParameters params) throws NotSupportedExtensionException, RasterDriverException;
63
	
64
	
65
	/**
66
	 * Registers raster providers that support tiles. This method is only for providers. 
67
	 * In a far future it will be in the SPI.
68
	 * @param provider
69
	 */
70
	public void registerFileProvidersTiled(Class<?> provider);
71
		
72
	/**
73
	 * Gets the list of raster providers that support tiles. This method is only for providers. 
74
	 * In a far future it will be in the SPI.
75
	 * @return
76
	 */
77
	public void registerTileProviderFormats(Class<?> c);
78
	
79
	/**
80
	 * Register a format and a provider which is capable to manage this format
81
	 * @param ext Extension
82
	 * @param c Provider class
83
	 */
84
	public void addFormat(String ext, Class<?> c);
85
	
86
	/**
87
	 * Returns true if the extension is supported and false if doesn't
88
	 * @param ext
89
	 * @return
90
	 */
91
	public boolean isExtensionSupported(String ext, Class<?> c);
92
	
93
	/**
94
	 * Returns true if the extension is supported and false if doesn't
95
	 * @param ext
96
	 * @return
97
	 */
98
	public boolean isExtensionSupported(String ext);
99
	
100
	/**
101
	 * Returns the list of supported formats in read only mode
102
	 * @return
103
	 */
104
	public String[] getReadOnlyFormatList();
105
	
106
	/**
47 107
	 * Obtiene la lista de extensiones registradas
48 108
	 * @return Lista de extensiones registradas o null si no hay ninguna
49 109
	 */
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/DataStructFactory.java
21 21
*/
22 22
package org.gvsig.fmap.dal.coverage.datastruct;
23 23

  
24
import java.awt.geom.Dimension2D;
24 25
import java.awt.geom.Point2D;
25 26
import java.awt.geom.Rectangle2D;
26 27

  
28
import org.cresques.cts.IProjection;
27 29
import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
30
import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
28 31
import org.gvsig.fmap.dal.coverage.store.props.Transparency;
29 32

  
30 33
/**
......
150 153
	 */
151 154
	public GeoPoint createGeoPoint(Point2D p, Point2D m);
152 155
	
156
	/**
157
	 * Gets a new instance of a ColorInterpretation object
158
	 * @param A list of color interpretation strings
159
	 * @return
160
	 */
161
	public ColorInterpretation createColorInterpretation(String[] colorInterp);
162
	
163
	 /**
164
     * Builds a new ViewPortData object
165
     * @param proj
166
     * @param extent
167
     * @param size
168
     * @return
169
     */
170
    public ViewPortData createViewPortData(IProjection proj, Extent extent, Dimension2D size);
171
    
172
    /**
173
     * Builds a new ViewPortData object
174
     * @return
175
     */
176
    public ViewPortData createViewPortData();
177
	
153 178
}
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultProviderServices.java
47 47
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
48 48
import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
49 49
import org.gvsig.fmap.dal.coverage.store.DataServerWriter;
50
import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
50 51
import org.gvsig.fmap.dal.coverage.store.RasterWriter;
51 52
import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
52 53
import org.gvsig.fmap.dal.coverage.store.parameter.RasterFileStoreParameters;
......
55 56
import org.gvsig.fmap.dal.exception.InitializeException;
56 57
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
57 58
import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
59
import org.gvsig.fmap.dal.raster.spi.CoverageStoreProvider;
58 60
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer;
59 61
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters;
60 62
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters;
......
62 64
import org.gvsig.fmap.dal.spi.DataManagerProviderServices;
63 65
import org.gvsig.fmap.dal.spi.DataStoreProvider;
64 66
import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
67
import org.gvsig.raster.impl.DefaultRasterManager;
65 68
import org.gvsig.raster.impl.provider.DefaultRasterProvider;
66 69
import org.gvsig.raster.impl.provider.RasterProvider;
67 70
import org.gvsig.raster.impl.store.WriteFileFormatFeatures;
......
81 84
	public TreeMap<String, WriteFileFormatFeatures>
82 85
                                  fileFeature    = new TreeMap<String, WriteFileFormatFeatures>();
83 86

  
87
	public DefaultRasterManager getManager() {
88
		return (DefaultRasterManager)RasterLocator.getManager();
89
	}
90
	
84 91
	public TreeMap<String, WriteFileFormatFeatures> getFileFeature() {
85 92
		return fileFeature;
86 93
	}
87 94
	
88 95
	/**
96
	 * Abre un dataset pasando como par?metros la proyecci?n y un objeto identificador del dataset. Este
97
	 * objeto puede ser una ruta a un fichero en disco. En este caso la extensi?n del fichero servir? para
98
	 * buscar el driver que lo gestiona. Si proporcionamos un array de cadenas se tratar?n como la ruta a N ficheros
99
	 * de disco. Tambi?n puede ser un buffer de datos en memoria o cualquier otro objeto
100
	 * que pueda aceptar un driver.
101
	 * @param param Par?metros al driver
102
	 * @return RasterMultiDatset
103
	 * @throws NotSupportedExtensionException
104
	 * @throws RasterDriverException
105
	 */
106
	public RasterDataStore open(DataStoreParameters param) throws NotSupportedExtensionException, RasterDriverException {
107
		return getManager().open(param);
108
	}
109
	
110
	public RasterDataStore open(CoverageStoreProvider prov, DataStoreParameters params) throws NotSupportedExtensionException, RasterDriverException {
111
		return getManager().open(prov, params);
112
	}
113
	
114
	
115
	/**
89 116
	 * Loads the specific provider to download data
90 117
	 * @param file
91 118
	 * @return
......
141 168
		return null;
142 169
	}
143 170
	
144
	/*
145
	 * (non-Javadoc)
146
	 * @see org.gvsig.fmap.dal.coverage.util.ProviderServices#createNotTiledParameters(java.lang.String)
147
	 */
148 171
	public RasterDataParameters createNotTiledParameters(String id) throws InitializeException, ProviderNotRegisteredException {
149 172
		DataManagerProviderServices dataManager = (DataManagerProviderServices)DALLocator.getDataManager();
150 173
		ArrayList<RasterDataParameters> parametersList = createParametersList(id);
......
158 181
		return null;
159 182
	}
160 183

  
161
	/*
162
	 * (non-Javadoc)
163
	 * @see org.gvsig.fmap.dal.coverage.util.ProviderServices#createParameters(java.lang.String)
164
	 */
165 184
	@SuppressWarnings("unchecked")
166 185
	public RasterDataParameters createParameters(String id) {
167 186
		Iterator it = DALFileLocator.getFilesystemServerExplorerManager().getRegisteredProviders();
......
263 282
		return params;
264 283
	}
265 284
	
266
	/*
267
	 * (non-Javadoc)
268
	 * @see org.gvsig.fmap.dal.coverage.util.ProviderServices#getDriversExtensions()
269
	 */
270 285
	@SuppressWarnings("unchecked")
271 286
	public String[] getDriversExtensions() {
272 287
		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
......
275 290
	}
276 291
	
277 292
	public String[] getRODriversExtensions() {
278
		return RasterLocator.getManager().getReadOnlyFormatList();
293
		return getReadOnlyFormatList();
279 294
	}
280 295

  
281
	/*
282
	 * (non-Javadoc)
283
	 * @see org.gvsig.fmap.dal.coverage.util.ProviderServices#getExtensionsSupported(int, int, boolean)
284
	 */
285 296
	@SuppressWarnings("unchecked")
286 297
	public ArrayList<String> getExtensionsSupported(int dataType, int bands) throws RasterDriverException {
287 298
		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
......
303 314
		return result;
304 315
	}
305 316

  
306
	/*
307
	 * (non-Javadoc)
308
	 * @see org.gvsig.fmap.dal.coverage.util.ProviderServices#getWriteDriversType()
309
	 */
310 317
	@SuppressWarnings("unchecked")
311 318
	public String[] getWriteDriversType() {
312 319
		if (fileFeature.size() == 0)
......
322 329
		return list;
323 330
	}
324 331

  
325
	/*
326
	 * (non-Javadoc)
327
	 * @see org.gvsig.fmap.dal.coverage.util.ProviderServices#getWriteDriverType(java.lang.String)
328
	 */
329 332
	public String getWriteDriverType(String ext) {
330 333
		return ((WriteFileFormatFeatures) fileFeature.get(ext)).getDriverName();
331 334
	}
332 335

  
333
	/*
334
	 * (non-Javadoc)
335
	 * @see org.gvsig.fmap.dal.coverage.util.ProviderServices#getWriteNDrivers()
336
	 */
337 336
	public int getWriteNDrivers() {
338 337
		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
339 338
		ExtensionPoint point = extensionPoints.get("RasterWriter");
340 339
		return point.getCount();
341 340
	}
342 341

  
343
	/*
344
	 * (non-Javadoc)
345
	 * @see org.gvsig.fmap.dal.coverage.util.ProviderServices#getWriteNTypes()
346
	 */
347 342
	public int getWriteNTypes() {
348 343
		return fileFeature.size();
349 344
	}
350
	
351 345

  
352
	/*
353
	 * (non-Javadoc)
354
	 * @see org.gvsig.fmap.dal.coverage.util.ProviderServices#isSupportedThisFileToWrite(java.lang.String, int, int)
355
	 */
356 346
	public boolean isSupportedThisFileToWrite(String ext, int dataType, int bands) {
357 347
		WriteFileFormatFeatures features = (WriteFileFormatFeatures) fileFeature.get(ext);
358 348
		if (features == null)
......
395 385
		blocksManager.removeAllClients();
396 386
	}
397 387

  
398
	/*
399
	 * (non-Javadoc)
400
	 * @see org.gvsig.fmap.dal.coverage.util.ProviderServices#saveObjectToRmfFile(java.lang.String, java.lang.Class, java.lang.Object)
401
	 */
402 388
	@SuppressWarnings("unchecked")
403 389
	public void saveObjectToRmfFile(String file, Class class1, Object value) throws RmfSerializerException {
404 390
		String fileRMF = RasterLocator.getManager().getFileUtils().getNameWithoutExtension(file) + ".rmf";
......
406 392
		saveObjectToRmfFile(blocksManager, class1, value);
407 393
	}
408 394

  
409
	/*
410
	 * (non-Javadoc)
411
	 * @see org.gvsig.fmap.dal.coverage.util.ProviderServices#saveObjectToRmfFile(java.lang.String, java.lang.Object)
412
	 */
413 395
	public void saveObjectToRmfFile(String file, Object value) throws RmfSerializerException {
414 396
		saveObjectToRmfFile(file, value.getClass(), value);
415 397
	}
......
462 444
		throw new RmfSerializerException("No se ha encontrado la clase para el serializador");
463 445
	}
464 446
	
465
	/*
466
	 * (non-Javadoc)
467
	 * @see org.gvsig.fmap.dal.coverage.util.ProviderServices#exportBufferToFile(org.gvsig.fmap.dal.coverage.dataset.Buffer, double, java.lang.String, boolean, java.io.File, org.gvsig.fmap.dal.coverage.datastruct.Extent, org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation)
468
	 */
447
	@SuppressWarnings("deprecation")
469 448
	public void exportBufferToFile(Buffer bufResult, 
470 449
			double pixelSize, 
471 450
			String extension, 
......
523 502
		rw.dataWrite();
524 503
		rw.writeClose();
525 504
	}
505

  
506
	public void addFormat(String ext, Class<?> c) {
507
		getManager().addFormat(ext, c);
508
	}
509

  
510
	public String[] getReadOnlyFormatList() {
511
		return getManager().getReadOnlyFormatList();
512
	}
513

  
514
	public boolean isExtensionSupported(String ext, Class<?> c) {
515
		return getManager().isExtensionSupported(ext, c);
516
	}
517

  
518
	public boolean isExtensionSupported(String ext) {
519
		return getManager().isExtensionSupported(ext);
520
	}
521

  
522
	public void registerFileProvidersTiled(Class<?> provider) {
523
		getManager().registerFileProvidersTiled(provider);
524
	}
525

  
526
	public void registerTileProviderFormats(Class<?> c) {
527
		getManager().registerTileProviderFormats(c);
528
	}
526 529
}
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultDataStructFactory.java
21 21
*/
22 22
package org.gvsig.raster.impl.datastruct;
23 23

  
24
import java.awt.geom.Dimension2D;
24 25
import java.awt.geom.Point2D;
25 26
import java.awt.geom.Rectangle2D;
26 27

  
28
import org.cresques.cts.IProjection;
27 29
import org.gvsig.fmap.dal.coverage.RasterLibrary;
28 30
import org.gvsig.fmap.dal.coverage.dataset.Buffer;
29 31
import org.gvsig.fmap.dal.coverage.datastruct.ColorTableLibrary;
......
32 34
import org.gvsig.fmap.dal.coverage.datastruct.GeoPoint;
33 35
import org.gvsig.fmap.dal.coverage.datastruct.NoData;
34 36
import org.gvsig.fmap.dal.coverage.datastruct.TransparencyRange;
37
import org.gvsig.fmap.dal.coverage.datastruct.ViewPortData;
35 38
import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
39
import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
36 40
import org.gvsig.fmap.dal.coverage.store.props.Transparency;
37 41
import org.gvsig.raster.impl.datastruct.persistence.DefaultColorTableLibrary;
38 42
import org.gvsig.raster.impl.store.DefaultRasterStore;
43
import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
39 44
import org.gvsig.raster.impl.store.properties.DataStoreTransparency;
40 45

  
41 46
/**
......
112 117
	public GeoPoint createGeoPoint(Point2D p, Point2D m) {
113 118
		return new GeoPointImpl(p, m);
114 119
	}
120

  
121
	public ColorInterpretation createColorInterpretation(String[] colorInterp) {
122
		return new DataStoreColorInterpretation(colorInterp);
123
	}
124

  
125
	public ViewPortData createViewPortData(IProjection proj, Extent extent,
126
			Dimension2D size) {
127
		return new DefaultViewPortData(proj, extent, size);
128
	}
129

  
130
	public ViewPortData createViewPortData() {
131
		return new DefaultViewPortData();
132
	}
115 133
}

Also available in: Unified diff