Revision 3152

View differences:

org.gvsig.raster.wcs/tags/org.gvsig.raster.wcs-2.2.6/org.gvsig.raster.wcs.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.wcs.io</artifactId>
5
    <packaging>jar</packaging>
6
    <name>org.gvsig.raster.wcs.io</name>
7
    <parent>
8
        <groupId>org.gvsig</groupId>
9
        <artifactId>org.gvsig.raster.wcs</artifactId>
10
        <version>2.2.6</version>
11
    </parent>
12
    <dependencies>
13
        <dependency>
14
            <groupId>org.gvsig</groupId>
15
            <artifactId>org.gvsig.raster.cache.lib.api</artifactId>
16
            <scope>compile</scope>
17
        </dependency>
18
        <dependency>
19
            <groupId>org.gvsig</groupId>
20
            <artifactId>org.gvsig.raster.lib.api</artifactId>
21
            <scope>compile</scope>
22
        </dependency>
23
        <dependency>
24
            <groupId>org.gvsig</groupId>
25
            <artifactId>org.gvsig.raster.lib.impl</artifactId>
26
            <scope>compile</scope>
27
        </dependency>
28
        <dependency>
29
            <groupId>org.gvsig</groupId>
30
            <artifactId>org.gvsig.metadata.lib.basic.api</artifactId>
31
            <scope>compile</scope>
32
        </dependency>
33
        <dependency>
34
            <groupId>org.gvsig</groupId>
35
            <artifactId>org.gvsig.raster.wcs.remoteclient</artifactId>
36
            <scope>compile</scope>
37
        </dependency>
38
        <dependency>
39
            <groupId>org.gvsig</groupId>
40
            <artifactId>org.gvsig.remoteclient</artifactId>
41
            <scope>compile</scope>
42
        </dependency>
43
        <dependency>
44
            <groupId>org.gvsig</groupId>
45
            <artifactId>org.gvsig.tools.lib</artifactId>
46
            <scope>compile</scope>
47
        </dependency>
48
        <dependency>
49
            <groupId>org.gvsig</groupId>
50
            <artifactId>org.gvsig.i18n</artifactId>
51
            <scope>compile</scope>
52
        </dependency>
53
        
54
        <dependency>
55
            <groupId>org.gvsig</groupId>
56
            <artifactId>org.gvsig.projection.api</artifactId>
57
            <scope>compile</scope>
58
        </dependency>
59
        <dependency>
60
            <groupId>org.gvsig</groupId>
61
            <artifactId>org.gvsig.projection.cresques.impl</artifactId>
62
            <scope>runtime</scope>
63
        </dependency>
64
        <dependency>
65
            <groupId>org.gvsig</groupId>
66
            <artifactId>org.gvsig.compat.api</artifactId>
67
            <scope>compile</scope>
68
        </dependency>
69
        <dependency>
70
            <groupId>org.gvsig</groupId>
71
            <artifactId>org.gvsig.compat.se</artifactId>
72
            <scope>compile</scope>
73
        </dependency>
74
        <dependency>
75
            <groupId>org.gvsig</groupId>
76
            <artifactId>org.gvsig.fmap.dal.api</artifactId>
77
            <scope>compile</scope>
78
        </dependency>
79
        <dependency>
80
            <groupId>org.gvsig</groupId>
81
            <artifactId>org.gvsig.fmap.dal.impl</artifactId>
82
            <scope>compile</scope>
83
        </dependency>
84
        <dependency>
85
            <groupId>org.gvsig</groupId>
86
            <artifactId>org.gvsig.fmap.dal.file.lib</artifactId>
87
            <scope>compile</scope>
88
        </dependency>
89
        <dependency>
90
            <groupId>org.gvsig</groupId>
91
            <artifactId>org.gvsig.fmap.dal.spi</artifactId>
92
            <scope>compile</scope>
93
        </dependency>
94
        <dependency>
95
            <groupId>org.gvsig</groupId>
96
            <artifactId>org.gvsig.fmap.geometry.api</artifactId>
97
            <scope>compile</scope>
98
        </dependency>
99
        <dependency>
100
            <groupId>org.gvsig</groupId>
101
            <artifactId>org.gvsig.fmap.geometry.generalpath</artifactId>
102
            <scope>runtime</scope>
103
        </dependency>
104
        <dependency>
105
            <groupId>org.gvsig</groupId>
106
            <artifactId>org.gvsig.fmap.geometry.operation</artifactId>
107
            <scope>runtime</scope>
108
        </dependency>
109
    </dependencies>
110
</project>
0 111

  
org.gvsig.raster.wcs/tags/org.gvsig.raster.wcs-2.2.6/org.gvsig.raster.wcs.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.wcs/tags/org.gvsig.raster.wcs-2.2.6/org.gvsig.raster.wcs.io/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.raster.wcs.io.DefaultWCSIOLibrary
org.gvsig.raster.wcs/tags/org.gvsig.raster.wcs-2.2.6/org.gvsig.raster.wcs.io/src/main/resources/org/gvsig/raster/wcs/io/i18n/text.properties
1
error_connecting=Error conectando con el servidor
2
malformed_url=URL mal formada
0 3

  
org.gvsig.raster.wcs/tags/org.gvsig.raster.wcs-2.2.6/org.gvsig.raster.wcs.io/src/main/resources/org/gvsig/raster/wcs/io/i18n/text_en.properties
1
error_connecting=Error connecting with the server
2
malformed_url=Malformed URL
0 3

  
org.gvsig.raster.wcs/tags/org.gvsig.raster.wcs-2.2.6/org.gvsig.raster.wcs.io/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.raster.wcs.io.DefaultWCSIOLibrary
org.gvsig.raster.wcs/tags/org.gvsig.raster.wcs-2.2.6/org.gvsig.raster.wcs.io/src/main/java/org/gvsig/raster/wcs/io/WCSDataParameters.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.wcs.io;
24

  
25
import java.awt.geom.Point2D;
26
import java.awt.geom.Rectangle2D;
27
import java.util.Hashtable;
28
import java.util.Map;
29

  
30
import org.gvsig.compat.net.ICancellable;
31
import org.gvsig.fmap.dal.coverage.store.parameter.RemoteStoreParameters;
32

  
33
/**
34
 * Parameters for the WCS provider
35
 * @author Nacho Brodin (nachobrodin@gmail.com)
36
 */
37
public interface WCSDataParameters extends RemoteStoreParameters {
38
	/**
39
	 * Gets the time information for the request
40
	 * @return
41
	 */
42
	public Object getTime();
43
	
44
	/**
45
	 * Sets the time information for the request
46
	 * @param time
47
	 */
48
	public void setTime(String time);
49

  
50
	/**
51
	 * Gets the format
52
	 * @return Formato.
53
	 */
54
	public Object getFormat();
55
	
56
	/**
57
	 * Sets the format
58
	 * @param format Formato.
59
	 */
60
	public void setFormat(String format);
61

  
62
	public Object getSRSCode();
63

  
64
	public Object getURI();
65

  
66
	public String getCoverageName();
67
	
68
	public Point2D getMaxResolution();
69
	
70
	public String getParameter();
71
	
72
	/**
73
	 * Gets the bounding box
74
	 * @return
75
	 */
76
	public Rectangle2D getExtent();
77
	
78
	public int getWidth();
79
	
80
	public int getHeight();
81
	
82
	public boolean isOverridingHost();
83
	
84
	/**
85
	 * Gets the online resource map
86
	 * @param onlineResources
87
	 */
88
	public Map<String,String> getOnlineResource();
89
	
90
	public String getDepth();
91

  
92
	public void setCancellable(ICancellable cancel);
93
	
94
	public void setOverrideHost(boolean over);
95

  
96
	/**
97
	 * Assigns the extent. 
98
	 * When a provider is initialized this will need to know what is the extent before the request.
99
	 * 
100
	 * @param bBox
101
	 */
102
	public void setExtent(Rectangle2D bBox);
103

  
104
	public void setURI(String string);
105

  
106
	public void setSRS(String srs);
107

  
108
	public void setCoverageName(String selectedCoverageName);
109

  
110
	public void setParameter(String parameterString);
111

  
112
	public void setMaxResolution(Point2D maxRes);
113

  
114
	/**
115
	 * Sets the set of URLs that should be accessed for each operation performed
116
	 * to the server.
117
	 *
118
	 * @param onlineResources
119
	 */
120
	public void setOnlineResources(Hashtable<String, String> onlineResources);
121
	
122
	public void setDepth(String depth);
123

  
124
}
0 125

  
org.gvsig.raster.wcs/tags/org.gvsig.raster.wcs-2.2.6/org.gvsig.raster.wcs.io/src/main/java/org/gvsig/raster/wcs/io/WCSDataParametersImpl.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.wcs.io;
24

  
25
import java.awt.geom.Point2D;
26
import java.awt.geom.Rectangle2D;
27
import java.util.Hashtable;
28
import java.util.Map;
29

  
30
import org.gvsig.compat.net.ICancellable;
31
import org.gvsig.fmap.crs.CRSFactory;
32
import org.gvsig.fmap.dal.coverage.store.RasterDataServerExplorer;
33
import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
34
import org.gvsig.raster.impl.store.AbstractRasterDataParameters;
35
import org.gvsig.tools.ToolsLocator;
36
import org.gvsig.tools.dynobject.DelegatedDynObject;
37
import org.gvsig.tools.dynobject.DynClass;
38
import org.gvsig.tools.dynobject.DynStruct;
39
import org.gvsig.tools.persistence.PersistenceManager;
40

  
41
/**
42
 * Parameters for the WCS provider
43
 * @author Nacho Brodin (nachobrodin@gmail.com)
44
 */
45
public class WCSDataParametersImpl extends AbstractRasterDataParameters implements WCSDataParameters {
46
	private static final String      FIELD_TIME            = "time";
47
	private static final String      FIELD_MAXRES          = "maxres";
48
	private static final String      FIELD_PARAM           = "parameter";
49
	private static final String      FIELD_FORMAT          = "format";
50
	private static final String      FIELD_NAME            = "name";
51
	private static final String      FIELD_SRSSTR          = "srsstr";
52
	private static final String      FIELD_EXTENT          = "extent";
53
	private static final String      FIELD_WIDTH           = "width";
54
	private static final String      FIELD_HEIGHT          = "height";
55
	private static final String      FIELD_OVERRIDE        = "override";
56
	private static final String      FIELD_ONLINERESOURC   = "onlineresources";
57
	private static final String      FIELD_DEPTH           = "depth";
58
	private static final String      FIELD_DELETECACHE     = "deletecache";
59
	
60
	private DelegatedDynObject       delegatedDynObject    = null;
61
	protected static DynClass        DYNCLASS              = null;
62
	private ICancellable             cancel                = null;
63
	
64
	public WCSDataParametersImpl() {
65
		super();
66
		initialize();
67
	}
68
	
69
	protected void initialize() {
70
		this.delegatedDynObject = (DelegatedDynObject) ToolsLocator
71
				.getDynObjectManager().createDynObject(registerDynClass());
72
	}
73
	
74
	public static DynStruct registerDynClass() {
75
		PersistenceManager manager = ToolsLocator.getPersistenceManager();
76
		DynStruct definition = manager.getDefinition("WCSDataParameters_Persistent");
77
		if( definition == null ) {
78
			definition = manager.addDefinition(
79
					WCSDataParametersImpl.class,
80
					"WCSDataParameters_Persistent",
81
					"WCS DataParameters Persistency",
82
					null, 
83
					null
84
			);
85
		}
86

  
87
		AbstractRasterDataParameters.registerDynClass(definition);
88
		
89
		definition.addDynFieldObject(FIELD_MAXRES)
90
		.setClassOfValue(Point2D.class)
91
		.setMandatory(false);
92
		
93
		definition.addDynFieldString(FIELD_PARAM)
94
		.setMandatory(false);
95
		
96
		definition.addDynFieldString(FIELD_DEPTH)
97
		.setMandatory(false);
98
		
99
		definition.addDynFieldString(FIELD_TIME)
100
		.setMandatory(false);
101
		
102
		definition.addDynFieldObject(FIELD_EXTENT)
103
		.setDescription("Bounding box")
104
		.setClassOfValue(Rectangle2D.class)
105
		.setMandatory(false);
106
		
107
		definition.addDynFieldInt(FIELD_WIDTH)
108
		.setDescription("Width")
109
		.setMandatory(false);
110
		
111
		definition.addDynFieldInt(FIELD_HEIGHT)
112
		.setDescription("Height")
113
		.setMandatory(false);
114
		
115
		definition.addDynFieldString(FIELD_FORMAT)
116
		.setDescription("Format")
117
		.setMandatory(false);
118
		
119
		definition.addDynFieldString(FIELD_NAME)
120
		.setDescription("Name")
121
		.setMandatory(false);			
122
		
123
		definition.addDynFieldString(FIELD_SRSSTR)
124
		.setDescription("String that represents the SRS")
125
		.setMandatory(false);
126
		
127
		definition.addDynFieldBoolean(FIELD_OVERRIDE)
128
		.setDescription("Override a host capabilities")
129
		.setMandatory(false);
130
		
131
		definition.addDynFieldMap(FIELD_ONLINERESOURC)
132
		.setDescription("online resources")
133
		.setClassOfItems(String.class)
134
		.setMandatory(false);
135
		
136
		definition.addDynFieldBoolean(FIELD_DELETECACHE)
137
		.setDescription("Flag to delete cache the next request")
138
		.setMandatory(false);
139

  
140
		return definition;
141
	}
142
	
143
	public void setMaxResolution(Point2D res) {
144
		this.setDynValue(FIELD_MAXRES, res);
145
	}
146
	
147
	public Point2D getMaxResolution() {
148
		return (Point2D) this.getDynValue(FIELD_MAXRES);
149
	}
150
	
151
	public void setParameter(String parameter) {
152
		this.setDynValue(FIELD_PARAM, parameter);
153
	}
154
	
155
	public String getParameter() {
156
		return (String) this.getDynValue(FIELD_PARAM);
157
	}
158
	
159
	public String getFormat() {
160
		return (String) this.getDynValue(FIELD_FORMAT);
161
	}
162

  
163
	public void setFormat(String format) {
164
		this.setDynValue(FIELD_FORMAT, format);
165
	}
166
	
167
	/**
168
	 * Devuelve el SRS.
169
	 * @return SRS.
170
	 */
171
	public String getSRSCode() {
172
		return (String) this.getDynValue(FIELD_SRSSTR);
173
	}
174
	
175
	/**
176
	 * Inserta el SRS.
177
	 * @param m_srs SRS.
178
	 */
179
	public void setSRS(String m_srs) {
180
		this.setDynValue(FIELD_SRSSTR, m_srs);
181
		if(m_srs.equals("CRS:84"))
182
			m_srs = "EPSG:4326";
183
		setSRS(CRSFactory.getCRS(m_srs));
184
	}
185
	
186
	public void setSRSID(String srsid) {
187
		if (srsid == null) {
188
			setDynValue(FIELD_SRSSTR, null);
189
		} else {
190
			setDynValue(FIELD_SRSSTR, CRSFactory.getCRS(srsid));
191
		}
192
	}
193
	
194
	public String getCoverageName() {
195
		return (String) this.getDynValue(FIELD_NAME);
196
	}
197

  
198
	public void setCoverageName(String name) {
199
		this.setDynValue(FIELD_NAME, name);
200
	}
201
	
202
	public void setCancellable(ICancellable cancel) {
203
		this.cancel = cancel;
204
	}
205
	
206
	public ICancellable getCancellable() {
207
		return this.cancel;
208
	}
209
	
210
	public void setExtent(Rectangle2D bBox) {
211
		this.setDynValue(FIELD_EXTENT, bBox);
212
	}
213
	
214
	public void setWidth(int w) {
215
		this.setDynValue(FIELD_WIDTH, new Integer(w));
216
	}
217
	
218
	public void setHeight(int h) {
219
		this.setDynValue(FIELD_HEIGHT, new Integer(h));
220
	}
221
	
222
	public Rectangle2D getExtent() {
223
		return (Rectangle2D)getDynValue(FIELD_EXTENT);
224
	}
225
	
226
	/**
227
	 * Gets the width
228
	 * @return
229
	 */
230
	public int getWidth() {
231
		Integer b = (Integer)getDynValue(FIELD_WIDTH);
232
		if(b != null)
233
			return ((Integer)b).intValue();
234
		return 0;
235
	}
236
	
237
	/**
238
	 * Gets the height
239
	 * @return
240
	 */
241
	public int getHeight() {
242
		Integer b = (Integer)getDynValue(FIELD_HEIGHT);
243
		if(b != null)
244
			return ((Integer)b).intValue();
245
		return 0;
246
	}
247
	
248
	//**********************************************
249
	
250
	public String getDataStoreName() {
251
		return WCSProvider.NAME;
252
	}
253
	
254
	public String getDescription() {
255
		return WCSProvider.DESCRIPTION;
256
	}
257

  
258
	public String getExplorerName() {
259
		return WCSProvider.NAME;
260
	}
261
	
262
	public boolean isValid() {
263
		return (this.getURI() != null);
264
	}
265
	
266
	protected DelegatedDynObject getDelegatedDynObject() {
267
		return delegatedDynObject;
268
	}
269
	
270
	@SuppressWarnings("unchecked")
271
	public WCSDataParametersImpl clone() {
272
		WCSDataParametersImpl p = new WCSDataParametersImpl();
273
		p.setFormat(getFormat());
274
		p.setHeight(getHeight());
275
		p.setWidth(getWidth());
276
		p.setExtent(getExtent());
277
		p.setCoverageName(getCoverageName());
278
		p.setOverrideHost(isOverridingHost());
279
		p.setSRS(getSRS());
280
		p.setSRS(getSRSCode());
281
		p.setURI(getURI());
282
		p.setCancellable(getCancellable());
283
		p.setOnlineResources((Hashtable<String, String>)this.getDynValue(FIELD_ONLINERESOURC));
284
		p.setTime(getTime());
285
		return p;
286
	}
287
	
288
	@SuppressWarnings("unchecked")
289
	public void assignFields(RasterDataParameters par, RasterDataServerExplorer explorer) {
290
		super.assignFields(par, explorer);
291
		WCSDataParametersImpl p = null;
292
		if(par instanceof WCSDataParametersImpl)
293
			p = (WCSDataParametersImpl)par;
294
		else
295
			return;
296
		setFormat(p.getFormat());
297
		setHeight(p.getHeight());
298
		setWidth(p.getWidth());
299
		setExtent(p.getExtent());
300
		setCoverageName(p.getCoverageName());
301
		setOverrideHost(p.isOverridingHost());
302
		setSRS(p.getSRS());
303
		setSRS(p.getSRSCode());
304
		setURI(p.getURI());
305
		setCancellable(p.getCancellable());
306
		setOnlineResources((Hashtable<String, String>)p.getDynValue(FIELD_ONLINERESOURC));
307
		setTime(p.getTime());
308
	}
309

  
310
	public String getTime() {
311
		return (String) this.getDynValue(FIELD_TIME);
312
	}
313

  
314
	public void setTime(String time) {
315
		this.setDynValue(FIELD_TIME, time);
316
	}
317
	
318
	public boolean isOverridingHost() {
319
		Boolean b = (Boolean)getDynValue(FIELD_OVERRIDE);
320
		if(b != null)
321
			return ((Boolean)b).booleanValue();
322
		return false;
323
	}
324
	
325
	public void setOverrideHost(boolean over) {
326
		this.setDynValue(FIELD_OVERRIDE, new Boolean(over));;
327
	}
328
	
329
	public void setOnlineResources(Hashtable<String, String> onlineResources) {
330
		this.setDynValue(FIELD_ONLINERESOURC, onlineResources);
331
	}
332
	
333
	@SuppressWarnings("unchecked")
334
	public Map<String,String> getOnlineResource() {
335
		return (Map<String,String>) this.getDynValue(FIELD_ONLINERESOURC);
336
	}
337

  
338
	/**
339
	 * Gets the URL that should be accessed for an operation performed
340
	 * to the server.
341
	 *
342
	 * @param onlineResources
343
	 */
344
	public String getOnlineResource(String operation) {
345
		return (String) getOnlineResource().get(operation);
346
	}
347
	
348
	
349
	public String getDepth() {
350
		return (String) this.getDynValue(FIELD_DEPTH);
351
	}
352

  
353
	
354
	public void setDepth(String depth) {
355
		this.setDynValue(FIELD_DEPTH, depth);
356
	}
357

  
358
	public boolean isSizeFixed() {
359
		return true;
360
	}
361
	
362
	public void deleteCache(boolean deleteCache) {
363
		this.setDynValue(FIELD_DELETECACHE, new Boolean(deleteCache));
364
	}
365
	
366
	public boolean isDeletingCache() {
367
		return ((Boolean)getDynValue(FIELD_DELETECACHE)).booleanValue();
368
	}
369

  
370
}
0 371

  
org.gvsig.raster.wcs/tags/org.gvsig.raster.wcs-2.2.6/org.gvsig.raster.wcs.io/src/main/java/org/gvsig/raster/wcs/io/DefaultWCSIOLibrary.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.wcs.io;
23

  
24
import org.gvsig.i18n.Messages;
25
import org.gvsig.tools.library.AbstractLibrary;
26
import org.gvsig.tools.library.LibraryException;
27
/**
28
 *
29
 * @author Nacho Brodin (nachobrodin@gmail.com)
30
 */
31
public class DefaultWCSIOLibrary extends AbstractLibrary {	
32

  
33
	public DefaultWCSIOLibrary() {
34
		/*super(DefaultWCSIOLibrary.class,Library.TYPE.IMPL);
35
		require(ToolsLibrary.class);
36
		require(DALLibrary.class);
37
		require(DALFileLibrary.class);*/
38
	}
39
	
40
	@Override
41
	protected void doInitialize() throws LibraryException {
42
		//RasterLibrary.wakeUp();
43
		WCSDataParametersImpl.registerDynClass();
44
		
45
		Messages.addResourceFamily("org.gvsig.raster.wcs.io.i18n.text",
46
				DefaultWCSIOLibrary.class.getClassLoader(),
47
				DefaultWCSIOLibrary.class.getClass().getName()); 
48
	}
49

  
50
	@Override
51
	protected void doPostInitialize() throws LibraryException {
52
		WCSServerExplorerParameters.registerDynClass();
53
		WCSDataParametersImpl.registerDynClass();
54
		WCSProvider.register();
55
	}
56
}
0 57

  
org.gvsig.raster.wcs/tags/org.gvsig.raster.wcs-2.2.6/org.gvsig.raster.wcs.io/src/main/java/org/gvsig/raster/wcs/io/downloader/TileDownloaderForWCS.java
1
package org.gvsig.raster.wcs.io.downloader;
2

  
3
import java.awt.geom.Rectangle2D;
4

  
5
import org.gvsig.fmap.dal.coverage.exception.RemoteServiceException;
6
import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
7
import org.gvsig.raster.cache.tile.Tile;
8
import org.gvsig.raster.cache.tile.exception.TileGettingException;
9
import org.gvsig.raster.impl.provider.tile.BaseTileDownloader;
10
import org.gvsig.raster.wcs.io.WCSConnector;
11
import org.gvsig.raster.wcs.io.WCSDataParametersImpl;
12
import org.gvsig.remoteclient.wcs.WCSStatus;
13

  
14
/** 
15
 * Tile getter 
16
 * @author Nacho Brodin (nachobrodin@gmail.com)
17
 */
18
public class TileDownloaderForWCS extends BaseTileDownloader {
19
	private WCSConnector             connector  = null;
20
	
21
	public TileDownloaderForWCS(RasterDataStore store, 
22
			int tilePxWidth,
23
			int tilePxHeight,
24
			WCSConnector connector) {
25
		super(store, tilePxWidth, tilePxHeight);
26
		this.connector = connector;
27
	}
28
	
29
	public synchronized Tile downloadTile(Tile tile) throws TileGettingException {
30
		try {
31
			Rectangle2D r = new Rectangle2D.Double(tile.getExtent().getMinX(), 
32
					tile.getExtent().getMinY() - tile.getExtent().getHeight(), 
33
					tile.getExtent().getWidth(), 
34
					tile.getExtent().getHeight());
35
			WCSDataParametersImpl p = (WCSDataParametersImpl)store.getParameters();
36
			WCSStatus wcsStatus = new WCSStatus();
37
			wcsStatus.setCoveraName(p.getCoverageName());
38
			wcsStatus.setSrs((String)p.getSRSCode());
39
			wcsStatus.setFormat((String)p.getFormat());
40
			wcsStatus.setDepth(p.getDepth());
41
			wcsStatus.setOnlineResource(p.getOnlineResource() != null ? (String) p.getOnlineResource().get("GetCoverage") : null);
42
			wcsStatus.setExtent(r);
43
			wcsStatus.setHeight(tile.getHeightPx());
44
			wcsStatus.setWidth(tile.getWidthPx());
45
			
46
			connector.getCoverageURL(wcsStatus, tile.getCancelled(), tile.getFile());
47
			//Si borramos el rmf no se puede leer la etiqueta Alpha. En caso de que se modifique jgdal para
48
			//poder guardar esta etiqueta deberiamos borrar el rmf para ahorrar ficheros
49
			//File rmf = new File(tile.getFile().getAbsolutePath() + ".rmf");
50
			//if(rmf.exists())
51
				//rmf.delete();
52
		} catch (RemoteServiceException e) {
53
			throw new TileGettingException(e);
54
		}
55
		readTileFromDisk(tile);
56
		return tile;
57
	}
58
	
59
}
0 60

  
org.gvsig.raster.wcs/tags/org.gvsig.raster.wcs-2.2.6/org.gvsig.raster.wcs.io/src/main/java/org/gvsig/raster/wcs/io/downloader/WCSTileServer.java
1
package org.gvsig.raster.wcs.io.downloader;
2

  
3
import org.cresques.cts.IProjection;
4
import org.gvsig.fmap.dal.coverage.RasterLibrary;
5
import org.gvsig.fmap.dal.coverage.datastruct.Extent;
6
import org.gvsig.fmap.dal.coverage.exception.RemoteServiceException;
7
import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
8
import org.gvsig.raster.cache.tile.TileCacheLibrary;
9
import org.gvsig.raster.cache.tile.TileCacheLocator;
10
import org.gvsig.raster.cache.tile.TileCacheManager;
11
import org.gvsig.raster.cache.tile.provider.CacheStruct;
12
import org.gvsig.raster.cache.tile.provider.Downloader;
13
import org.gvsig.raster.cache.tile.provider.TileServer;
14
import org.gvsig.raster.impl.provider.RasterProvider;
15
import org.gvsig.raster.wcs.io.WCSProvider;
16
import org.slf4j.Logger;
17
import org.slf4j.LoggerFactory;
18

  
19
/** 
20
* Data server for the tile cache in a WMSProvider 
21
* @author Nacho Brodin (nachobrodin@gmail.com)
22
*/
23
public class WCSTileServer implements TileServer {
24
	private static Logger              logger               = LoggerFactory.getLogger(WCSTileServer.class);
25
	private CacheStruct                struct               = null;
26
	private Downloader                 downloader           = null;
27
	private RasterDataStore            store                = null;
28
	private String                     suffix               = ".tif";
29
	
30
	public WCSTileServer(RasterDataStore store) {
31
		this.store = store;
32
		this.suffix = ((RasterProvider)store.getProvider()).getFileSuffix();
33
	}
34
	
35
	public Downloader getDownloader() {
36
		if(downloader == null ||
37
		   ((TileDownloaderForWCS)downloader).getTileSize()[0] != TileCacheLibrary.ALTERNATIVE_TILESIZE ||
38
		   ((TileDownloaderForWCS)downloader).getTileSize()[1] != TileCacheLibrary.ALTERNATIVE_TILESIZE) {
39
							
40
			try {
41
				downloader = new TileDownloaderForWCS(
42
						store, 
43
						TileCacheLibrary.ALTERNATIVE_TILESIZE, 
44
						TileCacheLibrary.ALTERNATIVE_TILESIZE, 
45
						((WCSProvider)store.getProvider()).getConnector());
46
			} catch (RemoteServiceException e) {
47
				return null;
48
			}
49
		}
50
		return downloader;
51
	}
52

  
53
	public CacheStruct getStruct() {
54
		if(struct == null) {
55
			TileCacheManager  manager = TileCacheLocator.getManager();
56
			
57
			int coordinates = CacheStruct.FLAT;
58
			if(store.getProjection() != null)
59
				coordinates = (store.getProjection() != null && store.getProjection().isProjected()) ? CacheStruct.FLAT : CacheStruct.GEOGRAFIC;
60
			else {
61
				Extent e = store.getExtent();
62
				if(e.getULX() >= -180 && e.getULX() <= 180 && e.getLRX() >= -180 && e.getLRX() <= 180 && 
63
					e.getULY() >= -90 && e.getULY() <= 90 && e.getLRY() >= -90 && e.getLRY() <= 90) {
64
					coordinates = CacheStruct.GEOGRAFIC;
65
				}
66
			}
67
			
68
			String epsg = null;
69
			IProjection proj = store.getProjection();
70
			if(proj != null)
71
				epsg = proj.getAbrev();
72
			
73
			struct = manager.createCacheStructure(coordinates, 
74
					TileCacheLibrary.DEFAULT_LEVELS, 
75
					store.getExtent().toRectangle2D(), 
76
					store.getCellSize(), 
77
					TileCacheLibrary.ALTERNATIVE_TILESIZE, 
78
					TileCacheLibrary.ALTERNATIVE_TILESIZE,
79
					((WCSProvider)store.getProvider()).getURIOfFirstProvider(),
80
					((WCSProvider)store.getProvider()).getParameters().getCoverageName(),
81
					TileCacheLibrary.DEFAULT_STRUCTURE,
82
					RasterLibrary.pathTileCache,
83
					getFileSuffix(),
84
					epsg,
85
					0);
86
		}
87
		return struct;
88
	}
89
	
90
	public void setStruct(CacheStruct struct) {
91
		if(struct != null) {
92
			this.struct = struct;
93
			if(struct.getTileSizeByLevel(0) != null) {
94
				try {
95
					downloader = new TileDownloaderForWCS(store, 
96
							struct.getTileSizeByLevel(0)[0], 
97
							struct.getTileSizeByLevel(0)[1],
98
							((WCSProvider)store.getProvider()).getConnector());
99
				} catch (RemoteServiceException ex) {
100
					logger.error("Constructing TileDownloaderForWCS: " + ex.getMessage());
101
				}
102
			}
103
		}
104
	}
105
	
106
	public String getFileSuffix() {
107
		return suffix;
108
	}
109
	
110
	public void setFileSuffix(String extension) {
111
		this.suffix = extension;
112
	}
113
}
0 114

  
org.gvsig.raster.wcs/tags/org.gvsig.raster.wcs-2.2.6/org.gvsig.raster.wcs.io/src/main/java/org/gvsig/raster/wcs/io/package.html
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
4
<head>
5
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
<title>org.gvsig.raster.wcs.io package documentation</title>
7
</head>
8
<body>
9

  
10
	<p>WCS provider</p>
11

  
12
</body>
13
</html>
0 14

  
org.gvsig.raster.wcs/tags/org.gvsig.raster.wcs-2.2.6/org.gvsig.raster.wcs.io/src/main/java/org/gvsig/raster/wcs/io/WCSLayerNode.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.wcs.io;
23

  
24
import java.awt.geom.Point2D;
25
import java.awt.geom.Rectangle2D;
26
import java.util.ArrayList;
27
import java.util.Hashtable;
28

  
29
/**
30
 * Class defining the node of the layer tree of a common WCS service.
31
 * @author jaume
32
 */
33
@SuppressWarnings("unchecked")
34
public class WCSLayerNode {
35
	private String       name                  = null;
36
	private ArrayList    srs                   = null;
37
	private String       title                 = null;
38
	private String       nativeSRS             = null;
39
	private ArrayList    formats               = null;
40
	private Point2D      maxRes                = null;
41
	private int          width                 = 0;
42
	private int          height                = 0;
43
	private ArrayList    timePositions         = null;
44
	private String       description           = null;
45
	private ArrayList    interpolationMethods  = null;
46
	private ArrayList    pList                 = null;
47
	private Hashtable    extents               = null;
48
	private String       latLonBox             = null;
49
	private String       lAbstract             = null;
50
	private ArrayList    children              = new ArrayList();
51
	private boolean      transparency;
52

  
53
	public void setName(String name) {
54
		this.name = name;
55
	}
56

  
57
	public void addAllSrs(ArrayList srs) {
58
		if (this.srs == null)
59
			this.srs = new ArrayList();
60
		this.srs.addAll(srs);
61
	}
62

  
63
	public void setTitle(String title) {
64
		this.title = title;
65
	}
66

  
67
	public void setNativeSRS(String nativeSRS) {
68
		this.nativeSRS = nativeSRS;
69
	}
70

  
71
	public String getName() {
72
		return name;
73
	}
74

  
75
	public void setFormats(ArrayList formats) {
76
		this.formats = formats;
77
	}
78

  
79
	public ArrayList getFormats() {
80
		return formats;
81
	}
82

  
83
	public ArrayList getSRSs() {
84
		if (!srs.contains(nativeSRS)) {
85
			ArrayList l = new ArrayList(srs);
86
			l.add(nativeSRS);
87
			return l;
88
		}
89
		return srs;
90
	}
91

  
92
	public String getTitle() {
93
		return title;
94
	}
95

  
96
	public Rectangle2D getExtent(String srs) {
97
		if ( extents != null ) {
98
			return (Rectangle2D) extents.get(srs);
99
		}
100
		return null;
101
	}
102
	
103
	public void addExtent(String srs, Rectangle2D extent) {
104
		if ( extents == null ) extents = new Hashtable();
105
		extents.put(srs, extent);
106
	}
107

  
108
	public Point2D getMaxRes() {
109
		return maxRes;
110
	}
111
	
112

  
113
	public void setMaxRes(Point2D maxRes) {
114
		this.maxRes = maxRes;
115
	}
116
	
117
	public String toString(){
118
    	String str;
119
    	if (getName()==null)
120
    		str = getTitle();
121
    	else
122
    		str = "["+getName()+"] "+getTitle();
123
        return str;
124
    }
125

  
126
	public void setTimePositions(ArrayList timePositions) {
127
		this.timePositions = timePositions;
128
	}
129
    
130
	public ArrayList getTimePositions() {
131
		return this.timePositions;
132
	}
133

  
134
	public String getDescription() {
135
		return this.description;
136
	}
137
	
138
	public void setDescription(String descr) {
139
		this.description = descr;
140
	}
141

  
142
	public String getLonLatEnvelope() {
143
		return "yet unimplemented";
144
	}
145

  
146
	public void setInterpolationMethods(ArrayList interpolationMethods) {
147
		this.interpolationMethods = interpolationMethods;
148
	}
149
	
150
	public ArrayList getInterpolationMethods() {
151
		return interpolationMethods;
152
	}
153

  
154
	public ArrayList getParameterList() {
155
		return pList;
156
	}
157
	
158
	public void addParameter(FMapWCSParameter p) {
159
		if (pList == null) pList = new ArrayList();
160
		pList.add(p);
161
	}
162
	
163
	/**
164
     * Gets the layer abstract.
165
     * @return Returns the abstract.
166
     */
167
    public String getAbstract() {
168
        return lAbstract;
169
    }
170

  
171
    /**
172
     * Sets the layer abstract.
173
     * @param abstract The abstract to set.
174
     */
175
    public void setAbstract(String _abstract) {
176
        lAbstract = _abstract;
177
    }
178
    
179
    public void setLatLonBox(String _latLonBox) {
180
        latLonBox = _latLonBox;
181
    }
182

  
183
    public String getLatLonBox() {
184
        return latLonBox;
185
    }
186
    
187
    /**
188
     * Gets the list of sons of this layer.
189
     */
190
    public ArrayList getChildren() {
191
        return children;
192
    }
193
    
194
    /**
195
     * Sets the list of sons of this layer.
196
     * @param children
197
     */
198
    public void setChildren(ArrayList children) {
199
        this.children = children;
200
    }
201
    
202
    /**
203
     * @return Returns the transparency.
204
     */
205
    public boolean isTransparent() {
206
        return transparency;
207
    }
208

  
209
    /**
210
     * @param transparency The transparency to set.
211
     */
212
    public void setTransparency(boolean transparency) {
213
        this.transparency = transparency;
214
    }
215

  
216
	public int getWidth() {
217
		return width;
218
	}
219

  
220
	public void setWidth(int width) {
221
		this.width = width;
222
	}
223

  
224
	public int getHeight() {
225
		return height;
226
	}
227

  
228
	public void setHeight(int height) {
229
		this.height = height;
230
	}
231

  
232
}
0 233

  
org.gvsig.raster.wcs/tags/org.gvsig.raster.wcs-2.2.6/org.gvsig.raster.wcs.io/src/main/java/org/gvsig/raster/wcs/io/FMapWCSParameter.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.wcs.io;
23

  
24
import java.util.ArrayList;
25

  
26
/**
27
 * Class abstracting WCS's axis descriptions into FMap
28
 * @author jaume dominguez faus - jaume.dominguez@iver.es
29
 * @TODO add interval parameters support
30
 */
31
@SuppressWarnings("unchecked")
32
public class FMapWCSParameter {
33
	public static final int VALUE_LIST = 0;
34
	public static final int INTERVAL = 1;
35
	private String name;
36
	private int type;
37
	private ArrayList valueList;
38
	private String label;
39

  
40
	public void setName(String name) {
41
		this.name = name;
42
	}
43

  
44
	public void setType(int type) {
45
		this.type = type;
46
	}
47

  
48
	public int getType() {
49
		return type;
50
	}
51

  
52
	public void setValueList(ArrayList singleValues) {
53
		this.valueList = singleValues;
54
	}
55

  
56
	public void setLabel(String label) {
57
		this.label = label;
58
	}
59

  
60
	public String toString() {
61
		return (label!=null) ? label : name;
62
	}
63

  
64
	public ArrayList getValueList() {
65
		return valueList;
66
	}
67

  
68
	public String getName() {
69
		return name;
70
	}
71
}
0 72

  
org.gvsig.raster.wcs/tags/org.gvsig.raster.wcs-2.2.6/org.gvsig.raster.wcs.io/src/main/java/org/gvsig/raster/wcs/io/WCSServerExplorer.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.wcs.io;
29

  
30
import java.awt.geom.Point2D;
31
import java.io.IOException;
32
import java.io.InputStream;
33
import java.net.MalformedURLException;
34
import java.net.URL;
35
import java.net.URLConnection;
36
import java.util.Hashtable;
37
import java.util.List;
38

  
39
import org.gvsig.compat.net.ICancellable;
40
import org.gvsig.fmap.dal.DALLocator;
41
import org.gvsig.fmap.dal.DataManager;
42
import org.gvsig.fmap.dal.DataServerExplorerParameters;
43
import org.gvsig.fmap.dal.DataStoreParameters;
44
import org.gvsig.fmap.dal.NewDataStoreParameters;
45
import org.gvsig.fmap.dal.coverage.exception.ConnectException;
46
import org.gvsig.fmap.dal.coverage.exception.RemoteServiceException;
47
import org.gvsig.fmap.dal.coverage.store.RasterDataServerExplorer;
48
import org.gvsig.fmap.dal.exception.DataException;
49
import org.gvsig.fmap.dal.exception.InitializeException;
50
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
51
import org.gvsig.fmap.dal.spi.DataServerExplorerProvider;
52
import org.gvsig.fmap.dal.spi.DataServerExplorerProviderServices;
53
import org.gvsig.i18n.Messages;
54

  
55
/**
56
 * Explorer for a WCS server
57
 * @author Nacho Brodin (nachobrodin@gmail.com)
58
 */
59
public class WCSServerExplorer implements RasterDataServerExplorer, DataServerExplorerProvider {
60
	private WCSConnector                connector                = null;
61
	private WCSServerExplorerParameters parameters               = null;
62
	
63
	public WCSServerExplorer(
64
			WCSServerExplorerParameters parameters,
65
			DataServerExplorerProviderServices services)
66
			throws InitializeException {
67
		this.parameters = parameters;
68
	}
69
	
70
	/**
71
	 * Gets the provider's name
72
	 * @return
73
	 */
74
	public String getDataStoreProviderName() {
75
		return WCSProvider.NAME;
76
	}
77
	
78
	public String getDescription() {
79
		return WCSProvider.DESCRIPTION;
80
	}
81
	
82
	public boolean add(String provider, NewDataStoreParameters parameters,
83
			boolean overwrite) throws DataException {
84
		return false;
85
	}
86

  
87
	public boolean canAdd() {
88
		return false;
89
	}
90

  
91
	public boolean canAdd(String storeName) throws DataException {
92
		return false;
93
	}
94

  
95
	public NewDataStoreParameters getAddParameters(String storeName)
96
			throws DataException {
97
		return null;
98
	}
99

  
100
	public List getDataStoreProviderNames() {
101
		return null;
102
	}
103

  
104
	public DataServerExplorerParameters getParameters() {
105
		return parameters;
106
	}
107

  
108
	public List list() throws DataException {
109
		return null;
110
	}
111

  
112
	public List list(int mode) throws DataException {
113
		return null;
114
	}
115

  
116
	public void remove(DataStoreParameters parameters) throws DataException {
117
		
118
	}
119

  
120
	public void dispose() {
121
		
122
	}
123

  
124
	public String getProviderName() {
125
		return null;
126
	}
127
	
128
	/**
129
	 * Gets the online resources
130
	 * @return
131
	 */
132
	public Hashtable getOnlineResources() {
133
		/*if(connector != null) {
134
			return connector.getOnlineResources();
135
		}*/
136
		return null;
137
	}
138
	
139
	//**********************************************
140
	//Connector
141
	//**********************************************
142
	
143
	public DataStoreParameters getStoredParameters() {
144
		DataManager manager = DALLocator.getDataManager();
145
		WCSDataParametersImpl params = null;
146
		try {
147
			params = (WCSDataParametersImpl) manager.createStoreParameters(this.getDataStoreProviderName());
148

  
149
			/*if(WCSProvider.TILED) {
150
				TileDataParameters tileParams = (TileDataParameters) manager.createStoreParameters("Tile Store");
151
				tileParams.setDataParameters(params);
152
				return tileParams;
153
			} */
154
			
155
		} catch (InitializeException e) {
156
			e.printStackTrace();
157
		} catch (ProviderNotRegisteredException e) {
158
			e.printStackTrace();
159
		}
160
		params.setURI(parameters.getHost());
161
		return params;
162
	}
163

  
164
	/**
165
	 * Connects to the server and throws a getCapabilities. This loads 
166
	 * the basic information to make requests.
167
	 * @throws RemoteServiceException 
168
	 */
169
	public void connect(ICancellable cancellable) throws ConnectException {
170
		URL url = null;
171
		boolean override = false;
172
		
173
		try {
174
			url = new URL(parameters.getHost());
175
		} catch (Exception e) {
176
			throw new ConnectException(Messages.getText("malformed_url"), e);
177
		}
178
        try {
179
        	connector = WCSProvider.getConnectorFromURL(url);
180
        	if (!connector.connect(override, cancellable))
181
        		throw new ConnectException(Messages.getText("error_connecting"));
182
        } catch (IOException e) {
183
			throw new ConnectException(Messages.getText("error_connecting"), e);
184
		}
185
		
186
	}
187
	
188
	/**
189
	 * Checks if the network and host are reachable
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff