Revision 5117

View differences:

org.gvsig.raster.tilecache/tags/org.gvsig.raster.tilecache-2.2.25/org.gvsig.raster.tilecache.io/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
	<modelVersion>4.0.0</modelVersion>
4
	<artifactId>org.gvsig.raster.tilecache.io</artifactId>
5
	<packaging>jar</packaging>
6
	<version>2.2.25</version>
7
	<name>org.gvsig.raster.tilecache.io</name>
8
	<parent>
9
        <groupId>org.gvsig</groupId>
10
        <artifactId>org.gvsig.raster.tilecache</artifactId>
11
        <version>2.2.25</version>
12
    </parent>
13
	<dependencies>
14
		<dependency>
15
			<groupId>org.gvsig</groupId>
16
			<artifactId>org.gvsig.raster.cache.lib.api</artifactId>
17
            <scope>compile</scope>
18
		</dependency>
19
        <dependency>
20
            <groupId>org.gvsig</groupId>
21
            <artifactId>org.gvsig.raster.cache.lib.impl</artifactId>
22
            <scope>compile</scope>
23
        </dependency>
24
		<dependency>
25
			<groupId>org.gvsig</groupId>
26
			<artifactId>org.gvsig.raster.lib.api</artifactId>
27
            <scope>compile</scope>
28
		</dependency>
29
        <dependency>
30
            <groupId>org.gvsig</groupId>
31
            <artifactId>org.gvsig.raster.lib.impl</artifactId>
32
            <scope>compile</scope>
33
        </dependency>
34
        <dependency>
35
            <groupId>org.gvsig</groupId>
36
            <artifactId>org.gvsig.metadata.lib.basic.api</artifactId>
37
            <scope>compile</scope>
38
        </dependency>
39
		<dependency>
40
            <groupId>org.gvsig</groupId>
41
            <artifactId>org.gvsig.tools.lib</artifactId>
42
            <scope>compile</scope>
43
        </dependency>
44
        
45
        <dependency>
46
            <groupId>org.gvsig</groupId>
47
            <artifactId>org.gvsig.projection.api</artifactId>
48
            <scope>compile</scope>
49
        </dependency>
50
        <dependency>
51
            <groupId>org.gvsig</groupId>
52
            <artifactId>org.gvsig.projection.cresques.impl</artifactId>
53
            <scope>runtime</scope>
54
        </dependency>
55
         <dependency>
56
            <groupId>org.gvsig</groupId>
57
            <artifactId>org.gvsig.compat.api</artifactId>
58
            <scope>compile</scope>
59
        </dependency>
60
        <dependency>
61
            <groupId>org.gvsig</groupId>
62
            <artifactId>org.gvsig.compat.se</artifactId>
63
            <scope>compile</scope>
64
        </dependency>
65
        <dependency>
66
            <groupId>org.gvsig</groupId>
67
            <artifactId>org.gvsig.fmap.dal.api</artifactId>
68
            <scope>compile</scope>
69
        </dependency>
70
        <dependency>
71
            <groupId>org.gvsig</groupId>
72
            <artifactId>org.gvsig.fmap.dal.impl</artifactId>
73
            <scope>compile</scope>
74
        </dependency>
75
        <dependency>
76
            <groupId>org.gvsig</groupId>
77
            <artifactId>org.gvsig.fmap.dal.file.lib</artifactId>
78
            <scope>compile</scope>
79
        </dependency>
80
        <dependency>
81
            <groupId>org.gvsig</groupId>
82
            <artifactId>org.gvsig.fmap.dal.spi</artifactId>
83
            <scope>compile</scope>
84
        </dependency>
85
        <dependency>
86
            <groupId>org.gvsig</groupId>
87
            <artifactId>org.gvsig.fmap.geometry.api</artifactId>
88
            <scope>compile</scope>
89
        </dependency>
90
    <!--
91
        <dependency>
92
            <groupId>org.gvsig</groupId>
93
            <artifactId>org.gvsig.fmap.geometry.generalpath</artifactId>
94
            <scope>runtime</scope>
95
        </dependency>
96
        <dependency>
97
            <groupId>org.gvsig</groupId>
98
            <artifactId>org.gvsig.fmap.geometry.operation</artifactId>
99
            <scope>runtime</scope>
100
        </dependency>
101
    -->
102
	</dependencies>
103
</project>
0 104

  
org.gvsig.raster.tilecache/tags/org.gvsig.raster.tilecache-2.2.25/org.gvsig.raster.tilecache.io/resources/README.txt
1
Put into this folder the resources needed by your test classes.
2

  
3
This folder is added to the Tests classpath, so you can load any resources 
4
through the ClassLoader.
5

  
6
By default, in this folder you can find an example of log4j configuration,
7
prepared to log messages through the console, so logging works when you
8
run your tests classes.
0 9

  
org.gvsig.raster.tilecache/tags/org.gvsig.raster.tilecache-2.2.25/org.gvsig.raster.tilecache.io/resources/log4j.xml
1
<?xml version="1.0" encoding="ISO-8859-1" ?>
2
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
3

  
4
<!-- 
5
Log4J configuration file for unit tests execution.
6
 -->
7
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
8

  
9
	<!-- Appender configuration to show logging messages through the console -->
10
	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
11
		<layout class="org.apache.log4j.PatternLayout">
12
			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
13
		</layout>
14
	</appender>
15

  
16
	<!-- 
17
	Activate logging messages of DEBUG level of higher only for the
18
	org.gvsig.tools packages.
19
	You can put full classes names or packages instead, to configure
20
	logging for all the classes and subpackages of the package.
21
	-->
22
	<category name="org.gvsig.tools">
23
		<priority value="DEBUG" />
24
	</category>
25
	<category name="org.gvsig.raster">
26
		<priority value="DEBUG" />
27
	</category>
28

  
29
	<!-- 
30
	By default, show only logging messages of INFO level or higher, 
31
	through the previously configured CONSOLE appender. 
32
	-->
33
	<root>
34
		<priority value="INFO" />
35
		<appender-ref ref="CONSOLE" />
36
	</root>
37
</log4j:configuration>
0 38

  
org.gvsig.raster.tilecache/tags/org.gvsig.raster.tilecache-2.2.25/org.gvsig.raster.tilecache.io/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.raster.cache.io.DefaultCacheIOLibrary
org.gvsig.raster.tilecache/tags/org.gvsig.raster.tilecache-2.2.25/org.gvsig.raster.tilecache.io/resources/TemplateRasterProvider.java
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.fmap.dal.coverage.dataset.io.netcdf;
23

  
24
import java.awt.geom.AffineTransform;
25

  
26
import org.gvsig.fmap.dal.DALFileLocator;
27
import org.gvsig.fmap.dal.DALLocator;
28
import org.gvsig.fmap.dal.DataStore;
29
import org.gvsig.fmap.dal.coverage.dataset.Buffer;
30
import org.gvsig.fmap.dal.coverage.dataset.io.tile.downloader.FileTileServer;
31
import org.gvsig.fmap.dal.coverage.datastruct.BandList;
32
import org.gvsig.fmap.dal.coverage.datastruct.Extent;
33
import org.gvsig.fmap.dal.coverage.exception.BandAccessException;
34
import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
35
import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
36
import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
37
import org.gvsig.fmap.dal.coverage.exception.ParsingException;
38
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
39
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
40
import org.gvsig.fmap.dal.coverage.store.RasterFileStoreParameters;
41
import org.gvsig.fmap.dal.spi.DataManagerProviderServices;
42
import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
43
import org.gvsig.metadata.MetadataLocator;
44
import org.gvsig.raster.cache.tile.provider.TileListener;
45
import org.gvsig.raster.cache.tile.provider.TileServer;
46
import org.gvsig.raster.impl.datastruct.ExtentImpl;
47
import org.gvsig.raster.impl.provider.DefaultRasterProvider;
48
import org.gvsig.raster.impl.provider.RasterProvider;
49
import org.gvsig.raster.impl.store.AbstractRasterDataParameters;
50
import org.gvsig.raster.impl.store.AbstractRasterDataStore;
51
import org.gvsig.raster.impl.store.DefaultStoreFactory;
52
import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
53
import org.gvsig.raster.impl.store.properties.DataStoreMetadata;
54
import org.gvsig.raster.impl.store.properties.DataStoreTransparency;
55
import org.gvsig.tools.ToolsLocator;
56
import org.gvsig.tools.extensionpoint.ExtensionPoint;
57
import org.gvsig.tools.extensionpoint.ExtensionPointManager;
58
/**
59
 * Data provider for ...
60
 *
61
 * @author Nacho Brodin (nachobrodin@gmail.com)
62
 */
63
public class NetCDFProvider extends DefaultRasterProvider {
64
	public static String        NAME                     = "Template Store";
65
	public static String        DESCRIPTION              = "Template Raster file";
66
	public final String         METADATA_DEFINITION_NAME = "TemplateStore";
67
	
68
	private static String[]     formatList               = new String[]{"*"};
69

  
70
	private Extent              viewRequest              = null;
71
	private TileServer          tileServer               = null;
72
	private boolean             open                     = false;
73

  
74
	public static void register() {
75
		DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator.getDataManager();
76
		if (dataman != null && !dataman.getStoreProviders().contains(NAME)) {
77
			dataman.registerStoreProvider(NAME,
78
					NetCDFProvider.class, NetCDFDataParameters.class);
79
		}
80
		
81
		if(DALFileLocator.getFilesystemServerExplorerManager() != null)
82
			DALFileLocator.getFilesystemServerExplorerManager().registerProvider(
83
					NAME, DESCRIPTION,
84
					NetCDFFilesystemServerExplorer.class);
85
		
86
		dataman.registerStoreFactory(NAME, DefaultStoreFactory.class);
87
	}
88
	
89
	
90
	/**
91
	 * Returns true if the extension is supported and false if doesn't
92
	 * @param ext
93
	 * @return
94
	 */
95
	public static boolean isExtensionSupported(String ext) {
96
		for (int i = 0; i < formatList.length; i++) {
97
			if(formatList[i].compareTo(ext) == 0)
98
				return true;
99
		}
100
		return false;
101
	}
102
	
103
	/**
104
	 * Constructor. Abre el dataset.
105
	 * @param proj Proyecci?n
106
	 * @param fName Nombre del fichero
107
	 * @throws NotSupportedExtensionException
108
	 */
109
	public NetCDFProvider(String params) throws NotSupportedExtensionException {
110
		super(params);
111
		if(params instanceof String) {
112
			NetCDFDataParameters p = new NetCDFDataParameters();
113
			p.setURI((String)params);
114
			super.init(p, null, ToolsLocator.getDynObjectManager()
115
					.createDynObject(
116
							MetadataLocator.getMetadataManager().getDefinition(
117
									DataStore.METADATA_DEFINITION_NAME)));
118
			init(p, null);
119
		}
120
	}
121
	
122
	public NetCDFProvider (NetCDFDataParameters params,
123
			AbstractRasterDataStore storeServices) throws NotSupportedExtensionException {
124
		super(params, storeServices, ToolsLocator.getDynObjectManager()
125
				.createDynObject(
126
						MetadataLocator.getMetadataManager().getDefinition(
127
								DataStore.METADATA_DEFINITION_NAME)));
128
		init(params, storeServices);
129
	}
130

  
131
	/**
132
	 * Crea las referencias al fichero y carga
133
	 * las estructuras con la informaci?n y los metadatos.
134
	 * @param proj Proyecci?n
135
	 * @param param Parametros de carga
136
	 * @throws NotSupportedExtensionException
137
	 */
138
	public void init (AbstractRasterDataParameters params,
139
			DataStoreProviderServices storeServices) throws NotSupportedExtensionException {
140
		//TODO:
141
		
142
		if(((RasterFileStoreParameters)params).getFile().exists()) {
143
			setParam(params);
144
			colorTable = null;
145
			noData = 0;
146
			wktProjection = null;
147
			//CrsWkt crs = new CrsWkt(wktProjection);
148
			//IProjection proj = CRSFactory.getCRS("EPSG:23030");
149
			noDataEnabled = true;
150
			ownTransformation = null;
151
			externalTransformation = (AffineTransform)ownTransformation.clone();
152
			load();
153
		} else
154
			setParam(params);
155
		bandCount = 0;
156
		setDataType(null);
157
		super.init();
158

  
159
		try {
160
			loadFromRmf(getRmfBlocksManager());
161
		} catch (ParsingException e) {
162
			//No lee desde rmf
163
		}
164
	}
165
	
166
	/*
167
	 * (non-Javadoc)
168
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#load()
169
	 */
170
	public RasterProvider load() {
171
		return this;
172
	}
173
	
174
	/*
175
	 * (non-Javadoc)
176
	 * @see org.gvsig.raster.impl.provider.RasterProvider#isOpen()
177
	 */
178
	public boolean isOpen() {
179
		return open;
180
	}
181

  
182
	/*
183
	 * (non-Javadoc)
184
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#close()
185
	 */
186
	public void close() {
187
		//TODO:
188
	}
189

  
190
	/*
191
	 * (non-Javadoc)
192
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#translateFileName(java.lang.String)
193
	 */
194
	public String translateFileName(String fileName) {
195
		return fileName;
196
	}
197

  
198
	/**
199
	 * Asigna el extent de la vista actual. existe un fichero .rmf debemos hacer una transformaci?n
200
	 * de la vista asignada ya que la petici?n viene en coordenadas del fichero .rmf y la vista (v)
201
	 * ha de estar en coordenadas del fichero.
202
	 */
203
	public void setView(Extent e) {
204
		viewRequest = new ExtentImpl(e);
205
	}
206

  
207
	/*
208
	 * (non-Javadoc)
209
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getView()
210
	 */
211
	public Extent getView() {
212
		return viewRequest;
213
	}
214

  
215
	/*
216
	 * (non-Javadoc)
217
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWidth()
218
	 */
219
	public double getWidth() {
220
		//TODO:
221
		return 0;
222
	}
223

  
224
	/*
225
	 * (non-Javadoc)
226
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getHeight()
227
	 */
228
	public double getHeight() {
229
		//TODO:
230
		return 0;
231
	}
232

  
233
	/**
234
	 * Read a line from the file
235
	 * @param line
236
	 * @param band
237
	 * @return
238
	 * @throws InvalidSetViewException
239
	 * @throws FileNotOpenException
240
	 * @throws RasterDriverException
241
	 * @Deprecated This operation is deprecated because is not useful and in the future
242
	 * it will not be maintained. The abstract operation has dissapear
243
	 */
244
	public Object readCompleteLine(int line, int band)throws InvalidSetViewException, FileNotOpenException, RasterDriverException {
245
		if(line > this.getHeight() || band > this.getBandCount())
246
			throw new InvalidSetViewException("Request out of grid");
247

  
248
		//TODO:
249
		return null;
250
	}
251

  
252
	/*
253
	 *  (non-Javadoc)
254
	 * @see org.gvsig.raster.dataset.RasterDataset#readBlock(int, int)
255
	 */
256
	public Object readBlock(int pos, int blockHeight)
257
		throws InvalidSetViewException, FileNotOpenException, RasterDriverException, ProcessInterruptedException {
258
		if(pos < 0)
259
			throw new InvalidSetViewException("Request out of grid");
260

  
261
		if((pos + blockHeight) > getHeight())
262
			blockHeight = Math.abs(((int)getHeight()) - pos);
263
		
264
		//TODO:
265
		return null;
266
	}
267

  
268
	/*
269
	 * (non-Javadoc)
270
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getData(int, int, int)
271
	 */
272
	public Object getData(int x, int y, int band)throws InvalidSetViewException, FileNotOpenException, RasterDriverException {
273
		if(x < 0 || y < 0 || x >= getWidth() || y >= getHeight())
274
			throw new InvalidSetViewException("Request out of grid");
275
		
276
		//TODO
277
		return null;
278
	}
279

  
280
	/*
281
	 * (non-Javadoc)
282
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(double, double, double, double, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.raster.cache.tile.provider.TileListener)
283
	 */
284
	public void getWindow(Extent ex, int bufWidth, int bufHeight, 
285
			BandList bandList, TileListener listener) throws ProcessInterruptedException, RasterDriverException {
286
		//TODO
287
	}
288

  
289
	/*
290
	 * (non-Javadoc)
291
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(org.gvsig.fmap.dal.coverage.datastruct.Extent, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer)
292
	 */
293
	public Buffer getWindow(Extent ex, BandList bandList, Buffer rasterBuf) 
294
		throws ProcessInterruptedException, RasterDriverException {
295
		//TODO
296

  
297
		return rasterBuf;
298
	}
299

  
300
	/*
301
	 * (non-Javadoc)
302
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(double, double, double, double, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer, boolean)
303
	 */
304
	public Buffer getWindow(double ulx, double uly, double w, double h, 
305
			BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws ProcessInterruptedException, RasterDriverException {
306
		//TODO
307

  
308
		return rasterBuf;
309
	}
310

  
311
	/*
312
	 * (non-Javadoc)
313
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(double, double, double, double, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer, boolean)
314
	 */
315
	public Buffer getWindow(Extent extent, 
316
			int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws ProcessInterruptedException, RasterDriverException {
317
		//TODO
318
		
319
		return rasterBuf;
320
	}
321

  
322
	/*
323
	 * (non-Javadoc)
324
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(int, int, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer)
325
	 */
326
	public Buffer getWindow(int x, int y, int w, int h, 
327
			BandList bandList, Buffer rasterBuf) throws ProcessInterruptedException, RasterDriverException {
328
		//TODO
329
		
330
		return rasterBuf;
331
	}
332

  
333
	/*
334
	 * (non-Javadoc)
335
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(int, int, int, int, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer)
336
	 */
337
	public Buffer getWindow(int x, int y, int w, int h, 
338
			int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf) throws ProcessInterruptedException, RasterDriverException {
339
		//TODO
340
		
341
		return rasterBuf;
342
	}
343

  
344
	/*
345
	 * (non-Javadoc)
346
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getBlockSize()
347
	 */
348
	public int getBlockSize(){
349
		//TODO
350
		
351
		return 0;
352
	}
353

  
354
	/*
355
	 * (non-Javadoc)
356
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getMetadata()
357
	 */
358
	public DataStoreMetadata getMetadata() {
359
		//TODO
360
		
361
		return null;
362
	}
363

  
364
	/*
365
	 * (non-Javadoc)
366
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getColorInterpretation()
367
	 */
368
	public DataStoreColorInterpretation getColorInterpretation(){
369
		//TODO
370
		
371
		return null;
372
	}
373

  
374
	/*
375
	 * (non-Javadoc)
376
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#setColorInterpretation(org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation)
377
	 */
378
	public void setColorInterpretation(DataStoreColorInterpretation colorInterpretation){
379
		//TODO
380
	}
381

  
382
	/*
383
	 * (non-Javadoc)
384
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getTransparency()
385
	 */
386
	public DataStoreTransparency getTransparency() {
387
		//TODO
388
		
389
		return null;
390
	}
391

  
392
	/*
393
	 * (non-Javadoc)
394
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#isGeoreferenced()
395
	 */
396
	public boolean isGeoreferenced() {
397
		//TODO
398
		
399
		return false;
400
	}
401

  
402
	/**
403
	 * Informa de si el driver ha supersampleado en el ?ltimo dibujado. Es el driver el que colocar?
404
	 * el valor de esta variable cada vez que dibuja.
405
	 * @return true si se ha supersampleado y false si no se ha hecho.
406
	 */
407
	public boolean isSupersampling() {
408
		//TODO
409
		
410
		return false;
411
	}
412

  
413
	/*
414
	 * (non-Javadoc)
415
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#setAffineTransform(java.awt.geom.AffineTransform)
416
	 */
417
	public void setAffineTransform(AffineTransform t){
418
		super.setAffineTransform(t);
419
	}
420

  
421
	/*
422
	 * (non-Javadoc)
423
	 * @see org.gvsig.raster.impl.provider.RasterProvider#getOverviewCount(int)
424
	 */
425
	public int getOverviewCount(int band) throws BandAccessException, RasterDriverException {
426
		if(band >= getBandCount())
427
			throw new BandAccessException("Wrong band");
428
		//TODO
429
		
430
		return 0;
431
	}
432

  
433
	/*
434
	 * (non-Javadoc)
435
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getOverviewWidth(int, int)
436
	 */
437
	public int getOverviewWidth(int band, int overview) throws BandAccessException, RasterDriverException {
438
		if (band >= getBandCount())
439
			throw new BandAccessException("Wrong band");
440
		//TODO
441
		
442
		return 0;
443
	}
444

  
445
	/*
446
	 * (non-Javadoc)
447
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getOverviewHeight(int, int)
448
	 */
449
	public int getOverviewHeight(int band, int overview) throws BandAccessException, RasterDriverException {
450
		if (band >= getBandCount())
451
			throw new BandAccessException("Wrong band");
452
		//TODO
453
		
454
		return 0;
455
	}
456

  
457
	/*
458
	 * (non-Javadoc)
459
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#overviewsSupport()
460
	 */
461
	public boolean overviewsSupport() {
462
		return true;
463
	}
464

  
465
	/*
466
	 * (non-Javadoc)
467
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#isReproyectable()
468
	 */
469
	public boolean isReproyectable() {
470
		return true;
471
	}
472

  
473
	/*
474
	 * (non-Javadoc)
475
	 * @see org.gvsig.fmap.dal.spi.DataStoreProvider#getName()
476
	 */
477
	public String getName() {
478
		return NAME;
479
	}
480
	
481
	/*
482
	 * (non-Javadoc)
483
	 * @see org.gvsig.raster.impl.provider.RasterProvider#setStatus(org.gvsig.raster.impl.provider.RasterProvider)
484
	 */
485
	public void setStatus(RasterProvider provider) {
486
		if(provider instanceof NetCDFProvider) {
487
			//Not implemented yet
488
		}
489
	}
490
	
491
	/*
492
	 * (non-Javadoc)
493
	 * @see org.gvsig.raster.impl.provider.RasterProvider#getTileServer()
494
	 */
495
	public TileServer getTileServer() {
496
		if(tileServer == null)
497
			tileServer = new FileTileServer(this);
498
		return tileServer;
499
	}
500
}
0 501

  
org.gvsig.raster.tilecache/tags/org.gvsig.raster.tilecache-2.2.25/org.gvsig.raster.tilecache.io/package.info
1
#
2
#Thu Mar 07 10:25:56 CET 2013
3
owner=gvSIG Association
4
code=org.gvsig.raster.tilecache.io
5
java-version=j1_5
6
official=true
7
type=plugin
8
version=2.0.0-0
9
state=devel
10
operating-system=all
11
dependencies=
12
sources-url=https\://devel.gvsig.org/redmine/projects/gvsig-raster/repository/show/org.gvsig.raster.tilecache/tags/2.0.0/org.gvsig.raster.tilecache.io
13
web-url=http\://www.gvsig.com
14
architecture=all
15
model-version=1.0.1
16
categories=
17
description=cache service for gvSIG
18
buildNumber=0
19
gvSIG-version=2.0.0
20
name=org.gvsig.raster.tilecache.io
org.gvsig.raster.tilecache/tags/org.gvsig.raster.tilecache-2.2.25/org.gvsig.raster.tilecache.io/src/main/java/org/gvsig/raster/tilecache/io/TileDataParametersImpl.java
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

  
23
package org.gvsig.raster.tilecache.io;
24

  
25
import java.net.URI;
26

  
27
import org.gvsig.fmap.dal.DataParameters;
28
import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
29
import org.gvsig.fmap.dal.coverage.store.parameter.TileDataParameters;
30
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters;
31
import org.gvsig.raster.cache.tile.provider.TileServer;
32
import org.gvsig.raster.impl.store.AbstractRasterDataParameters;
33
import org.gvsig.raster.impl.store.AbstractRasterFileDataParameters;
34
import org.gvsig.tools.ToolsLocator;
35
import org.gvsig.tools.dynobject.DelegatedDynObject;
36
import org.gvsig.tools.dynobject.DynStruct;
37
import org.gvsig.tools.persistence.PersistenceManager;
38

  
39
/**
40
 * Parameters for the <code>TileProvider</code>
41
 * @author Nacho Brodin (nachobrodin@gmail.com)
42
 */
43
public class TileDataParametersImpl extends AbstractRasterFileDataParameters implements TileDataParameters {
44
	public static final String       FIELD_PARAMETERS      = "parameters";
45
	public static final String       FIELD_SECONDLEVEL     = "secondlevel";
46
	public static final String       FIELD_NAME            = "name";
47
	private static final String      FIELD_DELETECACHE     = "deletecache";
48

  
49
	private DelegatedDynObject       delegatedDynObject    = null;
50
	private TileServer               tileServer            = null;
51

  
52
	public TileDataParametersImpl() {
53
		super();
54
		initialize();
55
	}
56

  
57
	protected void initialize() {
58
		this.delegatedDynObject = (DelegatedDynObject) ToolsLocator
59
				.getDynObjectManager().createDynObject(
60
						registerDynClass());
61
	}
62

  
63
	public static DynStruct registerDynClass() {
64
		PersistenceManager manager = ToolsLocator.getPersistenceManager();
65
		DynStruct definition = manager.getDefinition("TileDataParameters_Persistent");
66
		if( definition == null ) {
67
			definition = manager.addDefinition(
68
					TileDataParametersImpl.class,
69
					"TileDataParameters_Persistent",
70
					"TileDataParameters Persistency",
71
					null,
72
					null
73
					);
74
		}
75

  
76
		AbstractRasterDataParameters.registerDynClass(definition);
77

  
78
		definition.addDynFieldObject(FIELD_PARAMETERS)
79
		.setDescription("Provider")
80
		.setClassOfValue(RasterDataParameters.class)
81
		.setMandatory(true);
82

  
83
		definition.addDynFieldBoolean(FIELD_SECONDLEVEL)
84
		.setDescription("SecondLevelProvider")
85
		.setMandatory(false);
86

  
87
		definition.addDynFieldString(FIELD_NAME)
88
		.setDescription("Name")
89
		.setMandatory(false);
90

  
91
		definition.addDynFieldBoolean(FIELD_DELETECACHE)
92
		.setDescription("Flag to delete cache the next request")
93
		.setMandatory(false);
94
		return definition;
95
	}
96

  
97
	/**
98
	 * Sets the <code>DataParameters</code>
99
	 * @param params
100
	 */
101
	public void setDataParameters(DataParameters params) {
102
		this.setDynValue(FIELD_PARAMETERS, params);
103
	}
104

  
105
	public DataParameters getDataParameters() {
106
		return (DataParameters) this.getDynValue(FIELD_PARAMETERS);
107
	}
108

  
109
	/**
110
	 * Sets the <code>TileServer</code>
111
	 * @param tileServer
112
	 */
113
	public void setTileServer(TileServer tileServer) {
114
		this.tileServer = tileServer;
115
	}
116

  
117
	/**
118
	 * Gets the <code>TileServer</code>
119
	 * @return
120
	 */
121
	public TileServer getTileServer() {
122
		return tileServer;
123
	}
124

  
125
	/**
126
	 * Returns true if this provider is for the second level of cach?
127
	 * @return
128
	 */
129
	public boolean isSecondLevelCache() {
130
		Object obj = this.getDynValue(FIELD_SECONDLEVEL);
131
		if(obj != null && obj instanceof Boolean)
132
			return ((Boolean)obj).booleanValue();
133
		return false;
134
	}
135

  
136
	/**
137
	 * Sets the flag to inform to the provider that is a second level provider
138
	 * @param secondLevel
139
	 */
140
	public void setSecondLevelCache(boolean secondLevel) {
141
		this.setDynValue(FIELD_SECONDLEVEL, new Boolean(secondLevel));
142
	}
143

  
144
	/**
145
	 * Gets the name
146
	 * @return
147
	 */
148
	public String getName() {
149
		DataParameters p = getDataParameters();
150
		if(p != null) {
151
			if(p instanceof FilesystemStoreParameters) {
152
				return ((FilesystemStoreParameters)p).getFile().getAbsolutePath();
153
            } else {
154
                return ((RasterDataParameters) p).getURI().getPath();
155
            }
156
		}
157
		return null;
158
	}
159

  
160
	@Override
161
	public URI getURI() {
162
		if(this.getDynValue(FIELD_URI) == null) {
163
			DataParameters p = getDataParameters();
164
			if(p != null) {
165
				if(p instanceof FilesystemStoreParameters) {
166
					return ((FilesystemStoreParameters)p).getFile().toURI();
167
				} else {
168
                    return ((RasterDataParameters)p).getURI();
169
				}
170
			}
171
		}
172
		return (URI) this.getDynValue(FIELD_URI);
173
	}
174

  
175

  
176
	//**********************************************
177

  
178
	public String getDataStoreName() {
179
		return TileProvider.NAME;
180
	}
181

  
182
	public String getDescription() {
183
		return TileProvider.DESCRIPTION;
184
	}
185

  
186
	public String getExplorerName() {
187
		return TileServerExplorer.NAME;
188
	}
189

  
190
	public boolean isValid() {
191
		return (this.getDataParameters() != null);
192
	}
193

  
194
	protected DelegatedDynObject getDelegatedDynObject() {
195
		return delegatedDynObject;
196
	}
197

  
198
	/**
199
	 * Sets the flag to delete the cache
200
	 * @param deleteCache
201
	 */
202
	public void deleteCache(boolean deleteCache) {
203
		this.setDynValue(FIELD_DELETECACHE, new Boolean(deleteCache));
204
	}
205

  
206
	/**
207
	 * Returns true if the cache is going to be deleted
208
	 * @return
209
	 */
210
	public boolean isDeletingCache() {
211
		Boolean b = (Boolean)getDynValue(FIELD_DELETECACHE);
212
		if(b != null)
213
			return ((Boolean)getDynValue(FIELD_DELETECACHE)).booleanValue();
214
		else
215
			return false;
216
	}
217

  
218
	public boolean isSourceTiled() {
219
		return true;
220
	}
221
}
0 222

  
org.gvsig.raster.tilecache/tags/org.gvsig.raster.tilecache-2.2.25/org.gvsig.raster.tilecache.io/src/main/java/org/gvsig/raster/tilecache/io/tff/TileFileFormatExplorerParameters.java
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

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2009 IVER T.I   {{Task}}
26
*/
27

  
28
package org.gvsig.raster.tilecache.io.tff;
29

  
30
import org.gvsig.fmap.dal.DataServerExplorerParameters;
31
import org.gvsig.fmap.dal.spi.AbstractDataParameters;
32
import org.gvsig.tools.ToolsLocator;
33
import org.gvsig.tools.dynobject.DelegatedDynObject;
34
import org.gvsig.tools.dynobject.DynClass;
35
import org.gvsig.tools.dynobject.DynObjectManager;
36

  
37
/**
38
 * Parameters for the TileFileFormat explorer provider
39
 * @author Nacho Brodin (nachobrodin@gmail.com)
40
 */
41
public class TileFileFormatExplorerParameters extends AbstractDataParameters implements DataServerExplorerParameters {
42
	public static final String     DYNCLASS_NAME       = "TileFileFormatExplorerParameters";
43
	protected static DynClass      DYNCLASS            = null;
44
	private DelegatedDynObject     delegatedDynObject  = null;
45
	
46
	
47
	public TileFileFormatExplorerParameters() {
48
		super();
49
		initialize();
50
	}
51

  
52
	protected void initialize() {
53
		this.delegatedDynObject = (DelegatedDynObject) ToolsLocator
54
				.getDynObjectManager().createDynObject(
55
						DYNCLASS);
56
	}
57
	
58
	public static void registerDynClass() {
59
		DynObjectManager dynman = ToolsLocator.getDynObjectManager();
60
		DynClass dynClass;
61
		
62
		if(dynman == null)
63
			return;
64
		
65
		if (DYNCLASS == null) {
66
			dynClass = dynman.add(DYNCLASS_NAME);
67

  
68
			DYNCLASS = dynClass;
69
		}
70

  
71
	}
72
	
73
	protected DelegatedDynObject getDelegatedDynObject() {
74
		return delegatedDynObject;
75
	}
76

  
77
	public String getDataStoreName() {
78
		return TileFileFormatProvider.NAME;
79
	}
80
	
81
	public String getDescription() {
82
		return TileFileFormatProvider.DESCRIPTION;
83
	}
84
	
85
	public String getExplorerName() {
86
		return TileFileFormatProvider.NAME;
87
	}
88
}
0 89

  
org.gvsig.raster.tilecache/tags/org.gvsig.raster.tilecache-2.2.25/org.gvsig.raster.tilecache.io/src/main/java/org/gvsig/raster/tilecache/io/tff/TileFileFormatProvider.java
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.tilecache.io.tff;
23

  
24
import java.awt.geom.Point2D;
25
import java.io.File;
26

  
27
import org.gvsig.fmap.dal.DALFileLocator;
28
import org.gvsig.fmap.dal.DALLocator;
29
import org.gvsig.fmap.dal.DataStore;
30
import org.gvsig.fmap.dal.coverage.RasterLocator;
31
import org.gvsig.fmap.dal.coverage.datastruct.Extent;
32
import org.gvsig.fmap.dal.coverage.exception.BandAccessException;
33
import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
34
import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
35
import org.gvsig.fmap.dal.coverage.exception.InvalidSourceException;
36
import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
37
import org.gvsig.fmap.dal.coverage.exception.ParsingException;
38
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
39
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
40
import org.gvsig.fmap.dal.exception.InitializeException;
41
import org.gvsig.fmap.dal.exception.OpenException;
42
import org.gvsig.fmap.dal.spi.DataManagerProviderServices;
43
import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
44
import org.gvsig.metadata.MetadataLocator;
45
import org.gvsig.raster.cache.tile.Tile;
46
import org.gvsig.raster.cache.tile.exception.TileGettingException;
47
import org.gvsig.raster.cache.tile.provider.TileServer;
48
import org.gvsig.raster.impl.buffer.SpiRasterQuery;
49
import org.gvsig.raster.impl.provider.AbstractRasterProvider;
50
import org.gvsig.raster.impl.provider.RasterProvider;
51
import org.gvsig.raster.impl.provider.TiledRasterProvider;
52
import org.gvsig.raster.impl.store.DefaultStoreFactory;
53
import org.gvsig.tools.ToolsLocator;
54
import org.gvsig.tools.extensionpoint.ExtensionPoint;
55
import org.gvsig.tools.extensionpoint.ExtensionPointManager;
56

  
57
import org.slf4j.Logger;
58
import org.slf4j.LoggerFactory;
59

  
60
/**
61
 * Provider for <code>TileFileFormat</code>
62
 *
63
 * @author Nacho Brodin (nachobrodin@gmail.com)
64
 */
65
public class TileFileFormatProvider extends AbstractRasterProvider implements TiledRasterProvider {
66
	public static String                NAME                     = "TileFileFormat Store";
67
	public static String                DESCRIPTION              = "Tile file format Source";
68
	public static final String          METADATA_DEFINITION_NAME = "TileFileFormatStore";
69
	private static final Logger         logger                   = LoggerFactory.getLogger(TileFileFormatProvider.class);
70
	protected static String[]           formatList               = null;
71
	private boolean                     open                     = false;
72

  
73
	public static void register() {
74
		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
75
		registerFormats();
76

  
77
		ExtensionPoint point = extensionPoints.get("DefaultRasterProvider");
78
		point.append("reader", TileFileFormatProvider.NAME, TileFileFormatProvider.class);
79

  
80
		DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator.getDataManager();
81
		if (dataman != null && !dataman.getStoreProviders().contains(NAME)) {
82
			dataman.registerStoreProvider(NAME,
83
					TileFileFormatProvider.class, TileFileFormatDataParameters.class);
84
		}
85

  
86
		if(DALFileLocator.getFilesystemServerExplorerManager() != null)
87
			DALFileLocator.getFilesystemServerExplorerManager().registerProvider(
88
					NAME, DESCRIPTION,
89
					TileFileFormatFilesystemServerExplorer.class);
90

  
91
		dataman.registerStoreFactory(NAME, DefaultStoreFactory.class);
92
	}
93

  
94
	private static void registerFormats() {
95
		formatList      = new String[] {"tff"};
96
		for (int i = 0; i < formatList.length; i++)
97
			RasterLocator.getManager().getProviderServices().addFormat(formatList[i], TileFileFormatProvider.class);
98
	}
99

  
100
	public String[] getFormatList() {
101
		return formatList;
102
	}
103

  
104
	public boolean isExtensionSupported(String ext) {
105
		if(ext.indexOf(".") != -1)
106
			ext = ext.substring(ext.lastIndexOf(".") + 1, ext.length());
107
		for (int i = 0; i < formatList.length; i++) {
108
			if(formatList[i].compareTo(ext) == 0)
109
				return true;
110
		}
111
		return false;
112
	}
113

  
114
	public TileFileFormatProvider() throws NotSupportedExtensionException {
115
		super();
116
	}
117

  
118
	public TileFileFormatProvider(TileFileFormatDataParameters params,
119
			DataStoreProviderServices storeServices) throws InitializeException {
120
		super(params, storeServices, ToolsLocator.getDynObjectManager()
121
				.createDynObject(
122
						MetadataLocator.getMetadataManager().getDefinition(
123
								DataStore.METADATA_DEFINITION_NAME)));
124
		try {
125
			init(params, storeServices);
126
		} catch (OpenException e) {
127
			throw new InitializeException("Error open the source", e);
128
		} catch (NotSupportedExtensionException e) {
129
			throw new InitializeException("Not supported extension", e);
130
		}
131
	}
132

  
133
	/**
134
	 * Build file references
135
	 * @param proj Projection
136
	 * @param param Load parameters
137
	 * @throws NotSupportedExtensionException
138
	 */
139
	public void init(TileFileFormatDataParameters params,
140
			DataStoreProviderServices storeServices) throws NotSupportedExtensionException, OpenException {
141

  
142
		openFromTff();
143

  
144
		uri = getParameters().getURI();
145

  
146
		super.init();
147

  
148
		try {
149
			loadFromRmf(getRmfBlocksManager());
150
		} catch (ParsingException e) {
151
			logger.debug("Problems reading from RMF", e);
152
		}
153

  
154
		open = true;
155
	}
156

  
157
	/**
158
	 * Open from a .mff file.
159
	 * This method loads all providers and adds these to the parameters
160
	 * @throws OpenException
161
	 */
162
	private void openFromTff() throws OpenException {
163

  
164
	}
165

  
166
	public TileFileFormatDataParameters getParameters() {
167
		try {
168
			return (TileFileFormatDataParameters)parameters;
169
		} catch (ClassCastException e) {
170
			return null;
171
		}
172
	}
173

  
174
	@Override
175
	public int getBlockSize() {
176
		return 0;
177
	}
178

  
179
	@Override
180
	public Object getData(int x, int y, int band)
181
			throws InvalidSetViewException, FileNotOpenException,
182
			RasterDriverException {
183
		return null;
184
	}
185

  
186
	@Override
187
	public double getHeight() {
188
		return 0;
189
	}
190

  
191
	@Override
192
	public int getOverviewHeight(int band, int overview)
193
			throws BandAccessException, RasterDriverException {
194
		return 0;
195
	}
196

  
197
	@Override
198
	public int getOverviewWidth(int band, int overview)
199
			throws BandAccessException, RasterDriverException {
200
		return 0;
201
	}
202

  
203
	@Override
204
	public Extent getView() {
205
		return null;
206
	}
207

  
208
	@Override
209
	public double getWidth() {
210
		return 0;
211
	}
212

  
213
	@Override
214
	public boolean isOverviewsSupported() {
215
		return false;
216
	}
217

  
218
	@Override
219
	public RasterProvider load() {
220
		return null;
221
	}
222

  
223
	@Override
224
	public void setView(Extent e) {
225

  
226
	}
227

  
228
	public Extent getCoordsInLevel(Point2D viewCenter, int level, int w, int h) {
229
		return null;
230
	}
231

  
232
	public Extent getCoordsInTheNearestLevel(Extent extent, int w, int h) {
233
		return null;
234
	}
235

  
236
	public RasterProvider getInternalProvider() {
237
		return null;
238
	}
239

  
240
	public int getNearestLevel(double pixelSize) {
241
		return 0;
242
	}
243

  
244
	public Tile getTile(SpiRasterQuery q) throws TileGettingException {
245
		return null;
246
	}
247

  
248
	public int getZoomLevels() {
249
		return 0;
250
	}
251

  
252
	public int getOverviewCount(int band) throws BandAccessException,
253
			RasterDriverException {
254
		return 0;
255
	}
256

  
257
	public TileServer getTileServer() {
258
		return null;
259
	}
260

  
261
	public boolean isOpen() {
262
		return open;
263
	}
264

  
265
	public Object readBlock(int pos, int blockHeight, double scale)
266
			throws InvalidSetViewException, FileNotOpenException,
267
			RasterDriverException, ProcessInterruptedException {
268
		return null;
269
	}
270

  
271
	public void setStatus(RasterProvider provider) {
272

  
273
	}
274

  
275
	public String getProviderName() {
276
		return NAME;
277
	}
278

  
279
	@Override
280
	public void loadBuffer(SpiRasterQuery query)
281
			throws ProcessInterruptedException, RasterDriverException {
282
		// TODO Auto-generated method stub
283

  
284
	}
285

  
286
    /* (non-Javadoc)
287
     * @see org.gvsig.raster.impl.provider.RasterProvider#addFile(java.io.File)
288
     */
289
    @Override
290
    public void addFile(File file) throws InvalidSourceException {
291
        //Do nothing
292
    }
293

  
294
    /* (non-Javadoc)
295
     * @see org.gvsig.raster.impl.provider.RasterProvider#removeFile(java.io.File)
296
     */
297
    @Override
298
    public void removeFile(File file) {
299
        //Do nothing
300
    }
301

  
302
}
0 303

  
org.gvsig.raster.tilecache/tags/org.gvsig.raster.tilecache-2.2.25/org.gvsig.raster.tilecache.io/src/main/java/org/gvsig/raster/tilecache/io/tff/TileFileFormatNewRasterStoreParameters.java
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.tilecache.io.tff;
23

  
24
import org.gvsig.raster.impl.store.AbstractNewRasterStoreParameters;
25

  
26
/**
27
 * Parameters for creating a <code>TileFileFormat</code> store
28
 * @author Nacho Brodin (nachobrodin@gmail.com)
29
 */
30
public class TileFileFormatNewRasterStoreParameters extends AbstractNewRasterStoreParameters {
31

  
32
	public String getDataStoreName() {
33
		return TileFileFormatProvider.NAME;
34
	}
35

  
36
	public String getDescription() {
37
		return TileFileFormatProvider.DESCRIPTION;
38
	}
39

  
40
}
0 41

  
org.gvsig.raster.tilecache/tags/org.gvsig.raster.tilecache-2.2.25/org.gvsig.raster.tilecache.io/src/main/java/org/gvsig/raster/tilecache/io/tff/TileFileFormatFilesystemServerExplorer.java
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

  
23
package org.gvsig.raster.tilecache.io.tff;
24

  
25
import java.io.File;
26
import java.util.List;
27

  
28
import org.gvsig.fmap.dal.DALLocator;
29
import org.gvsig.fmap.dal.DataManager;
30
import org.gvsig.fmap.dal.DataServerExplorer;
31
import org.gvsig.fmap.dal.DataServerExplorerParameters;
32
import org.gvsig.fmap.dal.DataStoreParameters;
33
import org.gvsig.fmap.dal.NewDataStoreParameters;
34
import org.gvsig.fmap.dal.coverage.RasterLocator;
35
import org.gvsig.fmap.dal.exception.CreateException;
36
import org.gvsig.fmap.dal.exception.DataException;
37
import org.gvsig.fmap.dal.exception.InitializeException;
38
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
39
import org.gvsig.fmap.dal.exception.RemoveException;
40
import org.gvsig.fmap.dal.serverexplorer.filesystem.impl.AbstractFilesystemServerExplorerProvider;
41
import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderServices;
42
import org.gvsig.fmap.dal.spi.DataServerExplorerProviderServices;
43
import org.gvsig.raster.impl.store.AbstractRasterFileDataParameters;
44

  
45
public class TileFileFormatFilesystemServerExplorer extends AbstractFilesystemServerExplorerProvider {
46
	
47
	public TileFileFormatFilesystemServerExplorer() {
48
		
49
	}
50
	
51
	public TileFileFormatFilesystemServerExplorer(
52
			TileFileFormatExplorerParameters parameters,
53
			DataServerExplorerProviderServices services)
54
			throws InitializeException {
55
		System.out.println();
56
	}
57
	
58
	public String getDataStoreProviderName() {
59
		return TileFileFormatProvider.NAME;
60
	}
61
	
62
	public String getDescription() {
63
		return TileFileFormatProvider.DESCRIPTION;
64
	}
65
	
66
	public DataStoreParameters getStoreParameters() {
67
		DataManager manager = DALLocator.getDataManager();
68
		try {
69
			return  manager.createStoreParameters(this.getDataStoreProviderName());
70
		} catch (InitializeException e) {
71
			e.printStackTrace();
72
		} catch (ProviderNotRegisteredException e) {
73
			e.printStackTrace();
74
		}
75
		return null;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff