Revision 408

View differences:

org.gvsig.raster.netcdf/trunk/org.gvsig.raster.netcdf/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
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/xsd/maven-4.0.0.xsd">
3
	<modelVersion>4.0.0</modelVersion>
4
	<groupId>org.gvsig</groupId>
5
	<artifactId>org.gvsig.raster.netcdf</artifactId>
6
	<packaging>pom</packaging>
7
	<version>2.0.1-SNAPSHOT</version>
8
	<name>org.gvsig.raster.netcdf</name>
9
	<description>NetCDF adapter</description>
10
	<inceptionYear>2011</inceptionYear>
11
    <parent>
12
        <groupId>org.gvsig</groupId>
13
        <artifactId>gvsig-base-pom</artifactId>
14
        <version>2.0-SNAPSHOT</version>
15
    </parent>	
16
	<distributionManagement>
17
		<site>
18
			<id>gvsig-repository</id>
19
			<url>${site-repository}/</url>
20
		</site>
21
	</distributionManagement>
22

  
23
	<properties>
24
		<build-dir>${basedir}/../..</build-dir>
25
	</properties>
26
	<modules>
27
		<module>org.gvsig.raster.netcdf.io</module>
28
		<module>org.gvsig.raster.netcdf.app</module>
29
	</modules>
30
</project>
0 31

  
org.gvsig.raster.netcdf/trunk/org.gvsig.raster.netcdf/org.gvsig.raster.netcdf.io/src/main/java/org/gvsig/raster/netcdf/io/DefaultNetCDFIOLibrary.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.netcdf.io;
23

  
24
import org.gvsig.fmap.dal.DALFileLibrary;
25
import org.gvsig.fmap.dal.DALLibrary;
26
import org.gvsig.raster.impl.store.AbstractRasterFileDataParameters;
27
import org.gvsig.tools.ToolsLibrary;
28
import org.gvsig.tools.library.AbstractLibrary;
29
import org.gvsig.tools.library.Library;
30
import org.gvsig.tools.library.LibraryException;
31
/**
32
 *
33
 * @author Nacho Brodin (nachobrodin@gmail.com)
34
 */
35
public class DefaultNetCDFIOLibrary extends AbstractLibrary {	
36

  
37
	public DefaultNetCDFIOLibrary() {
38
		super(DefaultNetCDFIOLibrary.class,Library.TYPE.IMPL);
39
		require(ToolsLibrary.class);
40
		require(DALLibrary.class);
41
		require(DALFileLibrary.class);
42
	}
43
	
44
	@Override
45
	protected void doInitialize() throws LibraryException {
46
		//RasterLibrary.wakeUp();
47
	}
48

  
49
	@Override
50
	protected void doPostInitialize() throws LibraryException {
51
		//DefaultWMTSServerExplorerParameters.registerDynClass();
52
		//WMTSDataParametersImpl.registerDynClass();
53
		NetCDFProvider.register();
54
	}
55
}
0 56

  
org.gvsig.raster.netcdf/trunk/org.gvsig.raster.netcdf/org.gvsig.raster.netcdf.io/src/main/java/org/gvsig/raster/netcdf/io/NetCDFProvider.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
import java.io.IOException;
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.dataset.Buffer;
31
import org.gvsig.fmap.dal.coverage.dataset.io.tile.downloader.FileTileServer;
32
import org.gvsig.fmap.dal.coverage.datastruct.BandList;
33
import org.gvsig.fmap.dal.coverage.datastruct.Extent;
34
import org.gvsig.fmap.dal.coverage.exception.BandAccessException;
35
import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
36
import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
37
import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
38
import org.gvsig.fmap.dal.coverage.exception.ParsingException;
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.store.RasterFileStoreParameters;
42
import org.gvsig.fmap.dal.exception.OpenException;
43
import org.gvsig.fmap.dal.spi.DataManagerProviderServices;
44
import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
45
import org.gvsig.metadata.MetadataLocator;
46
import org.gvsig.raster.cache.tile.provider.TileListener;
47
import org.gvsig.raster.cache.tile.provider.TileServer;
48
import org.gvsig.raster.impl.datastruct.ExtentImpl;
49
import org.gvsig.raster.impl.provider.DefaultRasterProvider;
50
import org.gvsig.raster.impl.provider.RasterProvider;
51
import org.gvsig.raster.impl.store.AbstractRasterDataParameters;
52
import org.gvsig.raster.impl.store.AbstractRasterDataStore;
53
import org.gvsig.raster.impl.store.DefaultStoreFactory;
54
import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
55
import org.gvsig.raster.impl.store.properties.DataStoreMetadata;
56
import org.gvsig.raster.impl.store.properties.DataStoreTransparency;
57
import org.gvsig.tools.ToolsLocator;
58
import org.gvsig.tools.extensionpoint.ExtensionPoint;
59
import org.gvsig.tools.extensionpoint.ExtensionPointManager;
60

  
61
import ucar.nc2.NetcdfFile;
62
/**
63
 * Data provider for NetCDF files
64
 *
65
 * @author Nacho Brodin (nachobrodin@gmail.com)
66
 */
67
public class NetCDFProvider extends DefaultRasterProvider {
68
	public static String             NAME                     = "NetCDF Store";
69
	public static String             DESCRIPTION              = "NetCDF Raster file";
70
	public final String              METADATA_DEFINITION_NAME = "NetCDFStore";
71
	
72
	private static String[]          formatList               = new String[]{"nc"};
73

  
74
	private Extent                   viewRequest              = null;
75
	private TileServer               tileServer               = null;
76
	private boolean                  open                     = false;
77
	
78
    private NetcdfFile               netCDFFile               = null;
79

  
80
	public static void register() {
81
		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
82
		ExtensionPoint point = extensionPoints.get("RasterReader");
83
		addFormatsToRegistry(point, NetCDFProvider.class);
84
		
85
		point = extensionPoints.get("DefaultDriver");
86
		point.append("reader", "", NetCDFProvider.class);
87
		
88
		DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator.getDataManager();
89
		if (dataman != null && !dataman.getStoreProviders().contains(NAME)) {
90
			dataman.registerStoreProvider(NAME,
91
					NetCDFProvider.class, NetCDFDataParameters.class);
92
		}
93
		
94
		if(DALFileLocator.getFilesystemServerExplorerManager() != null)
95
			DALFileLocator.getFilesystemServerExplorerManager().registerProvider(
96
					NAME, DESCRIPTION,
97
					NetCDFFilesystemServerExplorer.class);
98
		
99
		dataman.registerStoreFactory(NAME, DefaultStoreFactory.class);
100
	}
101
	
102
	/**
103
	 * Adds the list format to the extension point
104
	 * @param point
105
	 */
106
	public static void addFormatsToRegistry(ExtensionPoint point, Class<?> c) {
107
		for (int i = 0; i < formatList.length; i++) {
108
			point.append(formatList[i], "", c);
109
		}
110
	}
111
	
112
	/**
113
	 * Returns true if the extension is supported and false if doesn't
114
	 * @param ext
115
	 * @return
116
	 */
117
	public static boolean isExtensionSupported(String ext) {
118
		for (int i = 0; i < formatList.length; i++) {
119
			if(formatList[i].compareTo(ext) == 0)
120
				return true;
121
		}
122
		return false;
123
	}
124
	
125
	/**
126
	 * Constructor. Abre el dataset.
127
	 * @param proj Proyecci?n
128
	 * @param fName Nombre del fichero
129
	 * @throws NotSupportedExtensionException
130
	 */
131
	public NetCDFProvider(String params) throws NotSupportedExtensionException, OpenException {
132
		super(params);
133
		if(params instanceof String) {
134
			NetCDFDataParameters p = new NetCDFDataParameters();
135
			p.setURI((String)params);
136
			super.init(p, null, ToolsLocator.getDynObjectManager()
137
					.createDynObject(
138
							MetadataLocator.getMetadataManager().getDefinition(
139
									DataStore.METADATA_DEFINITION_NAME)));
140
			init(p, null);
141
		}
142
	}
143
	
144
	public NetCDFProvider (NetCDFDataParameters params,
145
			AbstractRasterDataStore storeServices) throws NotSupportedExtensionException, OpenException {
146
		super(params, storeServices, ToolsLocator.getDynObjectManager()
147
				.createDynObject(
148
						MetadataLocator.getMetadataManager().getDefinition(
149
								DataStore.METADATA_DEFINITION_NAME)));
150
		init(params, storeServices);
151
	}
152

  
153
	/**
154
	 * Crea las referencias al fichero y carga
155
	 * las estructuras con la informaci?n y los metadatos.
156
	 * @param proj Proyecci?n
157
	 * @param param Parametros de carga
158
	 * @throws NotSupportedExtensionException
159
	 */
160
	public void init (AbstractRasterDataParameters params,
161
			DataStoreProviderServices storeServices) throws NotSupportedExtensionException, OpenException {
162
		
163
		//TODO:
164
		
165
		if(((RasterFileStoreParameters)params).getFile().exists()) {
166
            try { 
167
                netCDFFile = NetcdfFile.open(((RasterFileStoreParameters)params).getFile().getAbsolutePath());
168
            } catch (IOException e) {
169
                throw new OpenException("Imposible to read the file", e);
170
            }  
171

  
172
			setParam(params);
173
			colorTable = null;
174
			noData = 0;
175
			wktProjection = null;
176
			//CrsWkt crs = new CrsWkt(wktProjection);
177
			//IProjection proj = CRSFactory.getCRS("EPSG:23030");
178
			noDataEnabled = true;
179
			ownTransformation = null;
180
			externalTransformation = (AffineTransform)ownTransformation.clone();
181
			load();
182
		} else
183
			setParam(params);
184
		bandCount = 0;
185
		setDataType(null);
186
		super.init();
187

  
188
		try {
189
			loadFromRmf(getRmfBlocksManager());
190
		} catch (ParsingException e) {
191
			//No lee desde rmf
192
		}
193
	}
194
	
195
	/*
196
	 * (non-Javadoc)
197
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#load()
198
	 */
199
	public RasterProvider load() {
200
		return this;
201
	}
202
	
203
	/*
204
	 * (non-Javadoc)
205
	 * @see org.gvsig.raster.impl.provider.RasterProvider#isOpen()
206
	 */
207
	public boolean isOpen() {
208
		return open;
209
	}
210

  
211
	/*
212
	 * (non-Javadoc)
213
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#close()
214
	 */
215
	public void close() {
216
		//TODO:
217
	}
218

  
219
	/*
220
	 * (non-Javadoc)
221
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#translateFileName(java.lang.String)
222
	 */
223
	public String translateFileName(String fileName) {
224
		return fileName;
225
	}
226

  
227
	/**
228
	 * Asigna el extent de la vista actual. existe un fichero .rmf debemos hacer una transformaci?n
229
	 * de la vista asignada ya que la petici?n viene en coordenadas del fichero .rmf y la vista (v)
230
	 * ha de estar en coordenadas del fichero.
231
	 */
232
	public void setView(Extent e) {
233
		viewRequest = new ExtentImpl(e);
234
	}
235

  
236
	/*
237
	 * (non-Javadoc)
238
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getView()
239
	 */
240
	public Extent getView() {
241
		return viewRequest;
242
	}
243

  
244
	/*
245
	 * (non-Javadoc)
246
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWidth()
247
	 */
248
	public double getWidth() {
249
		//TODO:
250
		return 0;
251
	}
252

  
253
	/*
254
	 * (non-Javadoc)
255
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getHeight()
256
	 */
257
	public double getHeight() {
258
		//TODO:
259
		return 0;
260
	}
261

  
262
	/**
263
	 * Read a line from the file
264
	 * @param line
265
	 * @param band
266
	 * @return
267
	 * @throws InvalidSetViewException
268
	 * @throws FileNotOpenException
269
	 * @throws RasterDriverException
270
	 * @Deprecated This operation is deprecated because is not useful and in the future
271
	 * it will not be maintained. The abstract operation has dissapear
272
	 */
273
	public Object readCompleteLine(int line, int band)throws InvalidSetViewException, FileNotOpenException, RasterDriverException {
274
		if(line > this.getHeight() || band > this.getBandCount())
275
			throw new InvalidSetViewException("Request out of grid");
276

  
277
		//TODO:
278
		return null;
279
	}
280

  
281
	/*
282
	 *  (non-Javadoc)
283
	 * @see org.gvsig.raster.dataset.RasterDataset#readBlock(int, int)
284
	 */
285
	public Object readBlock(int pos, int blockHeight)
286
		throws InvalidSetViewException, FileNotOpenException, RasterDriverException, ProcessInterruptedException {
287
		if(pos < 0)
288
			throw new InvalidSetViewException("Request out of grid");
289

  
290
		if((pos + blockHeight) > getHeight())
291
			blockHeight = Math.abs(((int)getHeight()) - pos);
292
		
293
		//TODO:
294
		return null;
295
	}
296

  
297
	/*
298
	 * (non-Javadoc)
299
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getData(int, int, int)
300
	 */
301
	public Object getData(int x, int y, int band)throws InvalidSetViewException, FileNotOpenException, RasterDriverException {
302
		if(x < 0 || y < 0 || x >= getWidth() || y >= getHeight())
303
			throw new InvalidSetViewException("Request out of grid");
304
		
305
		//TODO
306
		return null;
307
	}
308

  
309
	/*
310
	 * (non-Javadoc)
311
	 * @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)
312
	 */
313
	public void getWindow(Extent ex, int bufWidth, int bufHeight, 
314
			BandList bandList, TileListener listener) throws ProcessInterruptedException, RasterDriverException {
315
		//TODO
316
	}
317

  
318
	/*
319
	 * (non-Javadoc)
320
	 * @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)
321
	 */
322
	public Buffer getWindow(Extent ex, BandList bandList, Buffer rasterBuf) 
323
		throws ProcessInterruptedException, RasterDriverException {
324
		//TODO
325

  
326
		return rasterBuf;
327
	}
328

  
329
	/*
330
	 * (non-Javadoc)
331
	 * @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)
332
	 */
333
	public Buffer getWindow(double ulx, double uly, double w, double h, 
334
			BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws ProcessInterruptedException, RasterDriverException {
335
		//TODO
336

  
337
		return rasterBuf;
338
	}
339

  
340
	/*
341
	 * (non-Javadoc)
342
	 * @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)
343
	 */
344
	public Buffer getWindow(Extent extent, 
345
			int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws ProcessInterruptedException, RasterDriverException {
346
		//TODO
347
		
348
		return rasterBuf;
349
	}
350

  
351
	/*
352
	 * (non-Javadoc)
353
	 * @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)
354
	 */
355
	public Buffer getWindow(int x, int y, int w, int h, 
356
			BandList bandList, Buffer rasterBuf) throws ProcessInterruptedException, RasterDriverException {
357
		//TODO
358
		
359
		return rasterBuf;
360
	}
361

  
362
	/*
363
	 * (non-Javadoc)
364
	 * @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)
365
	 */
366
	public Buffer getWindow(int x, int y, int w, int h, 
367
			int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf) throws ProcessInterruptedException, RasterDriverException {
368
		//TODO
369
		
370
		return rasterBuf;
371
	}
372

  
373
	/*
374
	 * (non-Javadoc)
375
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getBlockSize()
376
	 */
377
	public int getBlockSize(){
378
		//TODO
379
		
380
		return 0;
381
	}
382

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

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

  
403
	/*
404
	 * (non-Javadoc)
405
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#setColorInterpretation(org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation)
406
	 */
407
	public void setColorInterpretation(DataStoreColorInterpretation colorInterpretation){
408
		//TODO
409
	}
410

  
411
	/*
412
	 * (non-Javadoc)
413
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getTransparency()
414
	 */
415
	public DataStoreTransparency getTransparency() {
416
		//TODO
417
		
418
		return null;
419
	}
420

  
421
	/*
422
	 * (non-Javadoc)
423
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#isGeoreferenced()
424
	 */
425
	public boolean isGeoreferenced() {
426
		//TODO
427
		
428
		return false;
429
	}
430

  
431
	/**
432
	 * Informa de si el driver ha supersampleado en el ?ltimo dibujado. Es el driver el que colocar?
433
	 * el valor de esta variable cada vez que dibuja.
434
	 * @return true si se ha supersampleado y false si no se ha hecho.
435
	 */
436
	public boolean isSupersampling() {
437
		//TODO
438
		
439
		return false;
440
	}
441

  
442
	/*
443
	 * (non-Javadoc)
444
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#setAffineTransform(java.awt.geom.AffineTransform)
445
	 */
446
	public void setAffineTransform(AffineTransform t){
447
		super.setAffineTransform(t);
448
	}
449

  
450
	/*
451
	 * (non-Javadoc)
452
	 * @see org.gvsig.raster.impl.provider.RasterProvider#getOverviewCount(int)
453
	 */
454
	public int getOverviewCount(int band) throws BandAccessException, RasterDriverException {
455
		if(band >= getBandCount())
456
			throw new BandAccessException("Wrong band");
457
		//TODO
458
		
459
		return 0;
460
	}
461

  
462
	/*
463
	 * (non-Javadoc)
464
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getOverviewWidth(int, int)
465
	 */
466
	public int getOverviewWidth(int band, int overview) throws BandAccessException, RasterDriverException {
467
		if (band >= getBandCount())
468
			throw new BandAccessException("Wrong band");
469
		//TODO
470
		
471
		return 0;
472
	}
473

  
474
	/*
475
	 * (non-Javadoc)
476
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getOverviewHeight(int, int)
477
	 */
478
	public int getOverviewHeight(int band, int overview) throws BandAccessException, RasterDriverException {
479
		if (band >= getBandCount())
480
			throw new BandAccessException("Wrong band");
481
		//TODO
482
		
483
		return 0;
484
	}
485

  
486
	/*
487
	 * (non-Javadoc)
488
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#overviewsSupport()
489
	 */
490
	public boolean overviewsSupport() {
491
		return true;
492
	}
493

  
494
	/*
495
	 * (non-Javadoc)
496
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#isReproyectable()
497
	 */
498
	public boolean isReproyectable() {
499
		return true;
500
	}
501

  
502
	/*
503
	 * (non-Javadoc)
504
	 * @see org.gvsig.fmap.dal.spi.DataStoreProvider#getName()
505
	 */
506
	public String getName() {
507
		return NAME;
508
	}
509
	
510
	/*
511
	 * (non-Javadoc)
512
	 * @see org.gvsig.raster.impl.provider.RasterProvider#setStatus(org.gvsig.raster.impl.provider.RasterProvider)
513
	 */
514
	public void setStatus(RasterProvider provider) {
515
		if(provider instanceof NetCDFProvider) {
516
			//Not implemented yet
517
		}
518
	}
519
	
520
	/*
521
	 * (non-Javadoc)
522
	 * @see org.gvsig.raster.impl.provider.RasterProvider#getTileServer()
523
	 */
524
	public TileServer getTileServer() {
525
		if(tileServer == null)
526
			tileServer = new FileTileServer(this);
527
		return tileServer;
528
	}
529
}
0 530

  
org.gvsig.raster.netcdf/trunk/org.gvsig.raster.netcdf/org.gvsig.raster.netcdf.io/src/main/java/org/gvsig/raster/netcdf/io/NetCDFFilesystemServerExplorer.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.fmap.dal.coverage.dataset.io.netcdf;
29

  
30
import java.io.File;
31

  
32
import org.gvsig.fmap.dal.DALLocator;
33
import org.gvsig.fmap.dal.DataManager;
34
import org.gvsig.fmap.dal.DataServerExplorer;
35
import org.gvsig.fmap.dal.DataStoreParameters;
36
import org.gvsig.fmap.dal.NewDataStoreParameters;
37
import org.gvsig.fmap.dal.coverage.RasterLocator;
38
import org.gvsig.fmap.dal.exception.CreateException;
39
import org.gvsig.fmap.dal.exception.DataException;
40
import org.gvsig.fmap.dal.exception.RemoveException;
41
import org.gvsig.fmap.dal.serverexplorer.filesystem.impl.AbstractFilesystemServerExplorerProvider;
42
import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderServices;
43
import org.gvsig.raster.impl.store.AbstractRasterFileDataParameters;
44
import org.gvsig.raster.util.DefaultProviderServices;
45

  
46
public class NetCDFFilesystemServerExplorer extends AbstractFilesystemServerExplorerProvider {
47
	
48
	/*
49
	 * (non-Javadoc)
50
	 * @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#canCreate()
51
	 */
52
	public boolean canCreate() {
53
		return false;
54
	}
55

  
56
	/*
57
	 * (non-Javadoc)
58
	 * @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#canCreate(org.gvsig.fmap.dal.NewDataStoreParameters)
59
	 */
60
	public boolean canCreate(NewDataStoreParameters parameters) {
61
		return false;
62
	}
63

  
64
	/*
65
	 * (non-Javadoc)
66
	 * @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#create(org.gvsig.fmap.dal.NewDataStoreParameters, boolean)
67
	 */
68
	public void create(NewDataStoreParameters parameters, boolean overwrite)
69
			throws CreateException {
70
		throw new UnsupportedOperationException();
71
	}
72

  
73
	/*
74
	 * (non-Javadoc)
75
	 * @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#getCreateParameters()
76
	 */
77
	public NewDataStoreParameters getCreateParameters() throws DataException {
78
		return null;
79
	}
80

  
81
	/*
82
	 * (non-Javadoc)
83
	 * @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#initialize(org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderServices)
84
	 */
85
	public void initialize(
86
			FilesystemServerExplorerProviderServices serverExplorer) {
87
	}
88
	
89
	/*
90
	 * (non-Javadoc)
91
	 * @see org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider#remove(org.gvsig.fmap.dal.DataStoreParameters)
92
	 */
93
	public void remove(DataStoreParameters parameters) throws RemoveException {
94
		throw new UnsupportedOperationException();
95
	}
96

  
97
	/*
98
	 * (non-Javadoc)
99
	 * @see org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemFileFilter#getDataStoreProviderName()
100
	 */
101
	public String getDataStoreProviderName() {
102
		return NetCDFProvider.NAME;
103
	}
104

  
105
	/*
106
	 * (non-Javadoc)
107
	 * @see java.io.FileFilter#accept(java.io.File)
108
	 */
109
	public boolean accept(File pathname) {
110
		return ((DefaultProviderServices)RasterLocator.getManager().getProviderServices()).fileIsSupported(pathname.getName(), NetCDFProvider.class);
111
	}
112

  
113
	/*
114
	 * (non-Javadoc)
115
	 * @see org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemFileFilter#getDescription()
116
	 */
117
	public String getDescription() {
118
		return NetCDFProvider.DESCRIPTION;
119
	}
120

  
121
	public DataStoreParameters getParameters(File file) throws DataException {
122
		DataManager manager = DALLocator.getDataManager();
123
		AbstractRasterFileDataParameters params = (AbstractRasterFileDataParameters) manager
124
				.createStoreParameters(this.getDataStoreProviderName());
125
		params.setFile(file);
126
		return params;
127
	}
128
	
129
	public int getMode() {
130
		return DataServerExplorer.MODE_RASTER;
131
	}
132

  
133
}
0 134

  
org.gvsig.raster.netcdf/trunk/org.gvsig.raster.netcdf/org.gvsig.raster.netcdf.io/src/main/java/org/gvsig/raster/netcdf/io/NetCDFDataParameters.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.fmap.dal.coverage.dataset.io.netcdf;
29

  
30
import org.gvsig.raster.impl.store.AbstractRasterFileDataParameters;
31

  
32
/**
33
 * Parameters for the NetCDF provider
34
 * @author Nacho Brodin (nachobrodin@gmail.com)
35
 */
36
public class NetCDFDataParameters extends AbstractRasterFileDataParameters {
37
	
38
	/*
39
	 * (non-Javadoc)
40
	 * @see org.gvsig.fmap.dal.DataStoreParameters#getDataStoreName()
41
	 */
42
	public String getDataStoreName() {
43
		return NetCDFProvider.NAME;
44
	}
45
	
46
	/*
47
	 * (non-Javadoc)
48
	 * @see org.gvsig.fmap.dal.DataStoreParameters#getDescription()
49
	 */
50
	public String getDescription() {
51
		return NetCDFProvider.DESCRIPTION;
52
	}
53
}
0 54

  
org.gvsig.raster.netcdf/trunk/org.gvsig.raster.netcdf/org.gvsig.raster.netcdf.io/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.raster.netcdf.io.DefaultNetCDFIOLibrary
org.gvsig.raster.netcdf/trunk/org.gvsig.raster.netcdf/distribution/distribution.xml
1
<assembly>
2
</assembly>
0 3

  
org.gvsig.raster.netcdf/trunk/org.gvsig.raster.netcdf/.project
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>org.gvsig.raster.netcdf</name>
4
	<comment></comment>
5
	<projects>
6
	</projects>
7
	<buildSpec>
8
	</buildSpec>
9
	<natures>
10
	</natures>
11
</projectDescription>
0 12

  
org.gvsig.raster.netcdf/trunk/org.gvsig.raster.netcdf/org.gvsig.raster.netcdf.app/distribution/distribution.xml
1
<assembly>
2
</assembly>
0 3

  
org.gvsig.raster.netcdf/trunk/org.gvsig.raster.netcdf/org.gvsig.raster.netcdf.app/org.gvsig.raster.netcdf.app.netcdfclient/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2

  
3
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
    <modelVersion>4.0.0</modelVersion>
6
    <groupId>org.gvsig</groupId>
7
    <artifactId>org.gvsig.raster.netcdf.app</artifactId>
8
    <packaging>pom</packaging>
9
    <version>2.0.1-SNAPSHOT</version>
10
    <name>org.gvsig.raster.netcdf.app</name>
11
    <description>NetCDF adapter</description>
12
    <url>http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/docs/reference/org.gvsig.raster.app/${pom.version}</url>
13
    <parent>
14
        <groupId>org.gvsig</groupId>
15
        <artifactId>org.gvsig.maven.base.extension.pom</artifactId>
16
        <version>1.0.7-SNAPSHOT</version>
17
    </parent>
18

  
19
    <scm>
20
        <connection>scm:svn:https://svn.forge.osor.eu/svn/gvsig-raster/org.gvsig.raster.app/trunk/org.gvsig.raster.app</connection>
21
        <developerConnection>scm:svn:https://svn.forge.osor.eu/svn/gvsig-raster/org.gvsig.raster.app/trunk/org.gvsig.raster.app</developerConnection>
22
        <url>https://forge.osor.eu/plugins/scmsvn/viewcvs.php/org.gvsig.raster.app/trunk/org.gvsig.raster.app?root=gvsig-raster</url>
23
    </scm>
24

  
25
    <developers>
26
        <developer>
27
            <id>nbrodin</id>
28
            <name>Nacho Brodin</name>
29
            <email>nachobrodin@gmail.com</email>
30
            <roles>
31
                <role>Architect</role>
32
                <role>Developer</role>
33
            </roles>
34
        </developer>
35
    </developers>
36

  
37
    <distributionManagement>
38
        <site>
39
            <id>gvsig-repository</id>
40
            <url>scp://shell.forge.osor.eu/home/groups/gvsig-desktop/www/downloads/pub/projects/gvSIG-desktop/docs/reference/org.gvsig.raster.app/${pom.version}</url>
41
        </site>
42
    </distributionManagement>
43
    <repositories>
44
        <repository>
45
            <id>gvsig-public-http-repository</id>
46
            <name>gvSIG maven public HTTP repository</name>
47
            <url>http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/maven-repository</url>
48
            <releases>
49
                <enabled>true</enabled>
50
                <updatePolicy>daily</updatePolicy>
51
                <checksumPolicy>warn</checksumPolicy>
52
            </releases>
53
            <snapshots>
54
                <enabled>true</enabled>
55
                <updatePolicy>daily</updatePolicy>
56
                <checksumPolicy>warn</checksumPolicy>
57
            </snapshots>
58
        </repository>
59
    </repositories>
60
    <build>
61
        <plugins>
62
            <plugin>
63
                <groupId>org.apache.maven.plugins</groupId>
64
                <artifactId>maven-release-plugin</artifactId>
65
                <configuration>
66
                    <tagBase>https://svn.forge.osor.eu/svn/gvsig-raster/org.gvsig.raster.app/tags</tagBase>
67
                </configuration>
68
            </plugin>
69
        </plugins>
70
    </build>
71
    <dependencyManagement>
72
        <dependencies>
73
            <dependency>
74
                <groupId>org.gvsig</groupId>
75
                <artifactId>org.gvsig.core.maven.dependencies</artifactId>
76
                <type>pom</type>
77
                <version>2.0.1-SNAPSHOT</version>
78
                <scope>import</scope>
79
            </dependency>
80
        </dependencies>
81
    </dependencyManagement>
82
    <dependencies>
83
        <dependency>
84
            <groupId>org.gvsig</groupId>
85
            <artifactId>org.gvsig.andami</artifactId>
86
            <scope>compile</scope>
87
        </dependency>
88
        <dependency>
89
            <groupId>org.gvsig</groupId>
90
            <artifactId>org.gvsig.i18n</artifactId>
91
            <scope>compile</scope>
92
        </dependency>
93
        <dependency>
94
            <groupId>org.gvsig</groupId>
95
            <artifactId>org.gvsig.tools.lib</artifactId>
96
            <scope>compile</scope>
97
        </dependency>
98
        <dependency>
99
            <groupId>org.slf4j</groupId>
100
            <artifactId>slf4j-api</artifactId>
101
            <scope>compile</scope>
102
        </dependency>
103
        <dependency>
104
            <groupId>org.slf4j</groupId>
105
            <artifactId>slf4j-log4j12</artifactId>
106
            <scope>runtime</scope>
107
        </dependency>
108
    </dependencies>
109
    <modules>
110
        <module>org.gvsig.raster.netcdf.app.netcdfclient</module>
111
    </modules>
112
</project>
0 113

  
org.gvsig.raster.netcdf/trunk/org.gvsig.raster.netcdf/org.gvsig.raster.netcdf.app/org.gvsig.raster.netcdf.app.netcdfclient/distribution/distribution.xml
1
<assembly>
2
	<id>distribution</id>
3
	<formats>
4
		<format>dir</format>
5
	</formats>
6
	<fileSets>
7
		<!-- Estructure for the extension -->
8
		<fileSet>
9
			<directory>src/main/resources</directory>
10
			<outputDirectory>${extension.install.dir.name}
11
			</outputDirectory>
12
		</fileSet>
13
	</fileSets>
14
	<dependencySets>
15
		<dependencySet>
16
			<outputDirectory>${extension.install.dir.name}/${library-dir}
17
			</outputDirectory>
18
			<includes>
19
				<include>org.gvsig:org.gvsig.raster.netcdf.app.netcdfclient:jar</include>
20
			</includes>
21
		</dependencySet>
22
		
23
		<dependencySet>
24
			<useProjectAttachments>true</useProjectAttachments>
25
			<outputDirectory>${gvsig.extension.install.dir.name}/lib
26
			</outputDirectory>
27
			<includes>
28
				<include>org.gvsig:org.gvsig.raster.netcdf.io:jar</include>
29
				<include>org.gvsig:org.gvsig.raster.fmap:jar</include>
30
				<include>org.gvsig:org.gvsig.raster.lib.api:jar</include>
31
				<include>org.gvsig:org.gvsig.raster.lib.impl:jar</include>
32
				<include>org.gvsig:org.gvsig.raster.io.base:jar</include>
33
				<include>org.gvsig:org.gvsig.compat</include>
34
			</includes>
35
		</dependencySet>
36
	</dependencySets>
37
</assembly>
0 38

  

Also available in: Unified diff