Revision 7010 trunk/libraries/libRemoteServices/src/org/gvsig/remoteClient/wcs/WCSCoverage.java
WCSCoverage.java | ||
---|---|---|
39 | 39 |
* dac@iver.es |
40 | 40 |
*/ |
41 | 41 |
/** |
42 |
*
|
|
42 |
* |
|
43 | 43 |
*/ |
44 | 44 |
package org.gvsig.remoteClient.wcs; |
45 | 45 |
|
... | ... | |
50 | 50 |
import org.gvsig.remoteClient.ILayer; |
51 | 51 |
import org.gvsig.remoteClient.utils.BoundaryBox; |
52 | 52 |
import org.gvsig.remoteClient.utils.CapabilitiesTags; |
53 |
import org.gvsig.remoteClient.utils.DescribeCoverageTags; |
|
53 | 54 |
import org.kxml2.io.KXmlParser; |
54 | 55 |
import org.xmlpull.v1.XmlPullParserException; |
55 | 56 |
|
56 | 57 |
/** |
57 | 58 |
* Describes a coverage in a WCS server. |
58 |
*
|
|
59 |
* |
|
59 | 60 |
* @author jaume dominguez faus - jaume.domingue@iver.es |
60 | 61 |
* |
61 | 62 |
*/ |
... | ... | |
75 | 76 |
private String nativeSRS; |
76 | 77 |
private ArrayList supportedSRSs = new ArrayList(); |
77 | 78 |
private ArrayList interpolationMethods; |
78 |
private String nativeFormat;
|
|
79 |
private String nativeFormat; |
|
79 | 80 |
private ArrayList formats = new ArrayList(); |
80 |
|
|
81 |
|
|
81 | 82 |
public ArrayList getTimePositions() { |
82 | 83 |
return timePositions; |
83 | 84 |
} |
84 |
|
|
85 |
|
|
85 | 86 |
public void addTimePosition(String timeExpr) { |
86 | 87 |
if (timePositions == null) |
87 | 88 |
timePositions = new ArrayList(); |
... | ... | |
91 | 92 |
public ArrayList getFormats() { |
92 | 93 |
return formats; |
93 | 94 |
} |
94 |
|
|
95 |
|
|
95 | 96 |
public void addFormat(String format) { |
96 | 97 |
formats.add(format); |
97 | 98 |
} |
98 |
|
|
99 |
|
|
99 | 100 |
public void setNativeFormat(String nativeFormat) { |
100 | 101 |
this.nativeFormat = nativeFormat; |
101 | 102 |
} |
102 |
|
|
103 |
|
|
103 | 104 |
public String getNativeFormat() { |
104 | 105 |
return nativeFormat; |
105 | 106 |
} |
106 |
|
|
107 |
|
|
107 | 108 |
public String getNativeSRS() { |
108 | 109 |
return nativeSRS; |
109 | 110 |
} |
... | ... | |
177 | 178 |
public void setAbstract(String _abstract) { |
178 | 179 |
this._abstract = _abstract; |
179 | 180 |
} |
180 |
|
|
181 |
|
|
181 | 182 |
public void addBBox(BoundaryBox bBox) { |
182 | 183 |
bBoxes.put(bBox.getSrs(), bBox); |
183 | 184 |
} |
184 |
|
|
185 |
|
|
185 | 186 |
public ArrayList getAllSrs() { |
186 | 187 |
ArrayList mySrs = new ArrayList(); |
187 | 188 |
mySrs.addAll(supportedSRSs); |
... | ... | |
190 | 191 |
return mySrs; |
191 | 192 |
} |
192 | 193 |
/** |
193 |
* <p>returns the bbox with that id in the Bboxes vector</p>
|
|
194 |
* @param id
|
|
194 |
* <p>returns the bbox with that id in the Bboxes vector</p> |
|
195 |
* @param id |
|
195 | 196 |
*/ |
196 | 197 |
public BoundaryBox getBbox(String id) { |
197 | 198 |
if ((id.compareToIgnoreCase( CapabilitiesTags.EPSG_4326 )==0) |
198 | 199 |
||(id.compareToIgnoreCase( CapabilitiesTags.CRS_84)==0)) |
199 | 200 |
{ |
200 | 201 |
if (lonLatBbox != null) |
201 |
return lonLatBbox;
|
|
202 |
return lonLatBbox; |
|
202 | 203 |
} |
203 |
|
|
204 |
|
|
204 | 205 |
return (BoundaryBox)bBoxes.get(id); |
205 |
}
|
|
206 |
|
|
206 |
} |
|
207 |
|
|
207 | 208 |
public BoundaryBox getLatLonBox() { |
208 | 209 |
return lonLatBbox; |
209 | 210 |
} |
210 |
|
|
211 |
|
|
211 | 212 |
public void setLonLatBox(BoundaryBox box) { |
212 | 213 |
lonLatBbox = box; |
213 |
}
|
|
214 |
} |
|
214 | 215 |
|
215 | 216 |
public void addInterpolationMethod(String method) { |
216 | 217 |
if (interpolationMethods==null) interpolationMethods = new ArrayList(); |
217 | 218 |
interpolationMethods.add(method); |
218 | 219 |
} |
219 |
|
|
220 |
|
|
220 | 221 |
public ArrayList getInterpolationMethods() { |
221 | 222 |
return interpolationMethods; |
222 | 223 |
} |
223 | 224 |
/** |
224 | 225 |
* Parses the fragment of the XML document that describes this layer (or coverage) |
225 | 226 |
* @param parser |
226 |
* @throws IOException
|
|
227 |
* @throws XmlPullParserException
|
|
227 |
* @throws IOException |
|
228 |
* @throws XmlPullParserException |
|
228 | 229 |
*/ |
229 | 230 |
public abstract void parse(KXmlParser parser) throws XmlPullParserException, IOException; |
230 |
|
|
231 |
|
|
231 | 232 |
/** |
232 | 233 |
* Inner class describing the Rectified Grid of this coverage. |
233 |
*
|
|
234 |
* |
|
234 | 235 |
* @author jaume dominguez faus - jaume.dominguez@iver.es |
235 | 236 |
*/ |
236 | 237 |
public class RectifiedGrid { |
... | ... | |
258 | 259 |
axisNames[axisNames.length-1] = axisName; |
259 | 260 |
} |
260 | 261 |
} |
261 |
|
|
262 |
|
|
262 | 263 |
public String[] getAxisNames() { |
263 | 264 |
return axisNames; |
264 | 265 |
} |
265 |
|
|
266 |
|
|
266 | 267 |
public void addLowGridEnvelopLimit(int[] lowLimit) { |
267 | 268 |
if (lowGridEnvelopLimits == null) { |
268 | 269 |
lowGridEnvelopLimits = new int[1][1]; |
... | ... | |
276 | 277 |
lowGridEnvelopLimits[lowGridEnvelopLimits.length-1] = lowLimit; |
277 | 278 |
} |
278 | 279 |
} |
279 |
|
|
280 |
|
|
280 | 281 |
public int[][] getLowGridEnvelopLimits() { |
281 | 282 |
return lowGridEnvelopLimits; |
282 | 283 |
} |
283 |
|
|
284 |
|
|
284 | 285 |
public void addHighGridEnvelopLimit(int[] highLimit) { |
285 | 286 |
if (highGridEnvelopLimits == null) { |
286 | 287 |
highGridEnvelopLimits = new int[1][1]; |
... | ... | |
294 | 295 |
highGridEnvelopLimits[highGridEnvelopLimits.length-1] = highLimit; |
295 | 296 |
} |
296 | 297 |
} |
297 |
|
|
298 |
|
|
298 | 299 |
public int[][] getHighGridEnvelopLimits() { |
299 | 300 |
return highGridEnvelopLimits; |
300 | 301 |
} |
301 |
|
|
302 |
|
|
302 | 303 |
public void setOrigin(double[] _origins) { |
303 | 304 |
origins = _origins; |
304 | 305 |
} |
305 |
|
|
306 |
|
|
306 | 307 |
public double[] getOrigins() { |
307 | 308 |
return origins; |
308 | 309 |
} |
309 |
|
|
310 |
|
|
310 | 311 |
public void addToOffsetVector(double[] _offsetVector) { |
311 | 312 |
if (offsetVector == null) { |
312 | 313 |
offsetVector = new double[1][1]; |
... | ... | |
320 | 321 |
offsetVector[offsetVector.length-1] = _offsetVector; |
321 | 322 |
} |
322 | 323 |
} |
323 |
|
|
324 |
|
|
324 | 325 |
public double[][] getOffsetVector(){ |
325 | 326 |
return offsetVector; |
326 | 327 |
} |
327 |
|
|
328 |
|
|
328 | 329 |
public int getDimensionCount() { |
329 | 330 |
return dimensions; |
330 | 331 |
} |
... | ... | |
332 | 333 |
|
333 | 334 |
/** |
334 | 335 |
* Inner class describing the Axis Description of this coverage. |
335 |
*
|
|
336 |
* |
|
336 | 337 |
* @author jaume dominguez faus - jaume.dominguez@iver.es |
337 | 338 |
*/ |
338 | 339 |
public class AxisDescription { |
... | ... | |
341 | 342 |
private ArrayList singleValues = new ArrayList(); |
342 | 343 |
private String interval; |
343 | 344 |
private String defaultValue; |
344 |
|
|
345 |
|
|
345 | 346 |
public String getDefaultValue() { |
346 | 347 |
return defaultValue; |
347 | 348 |
} |
348 |
|
|
349 |
|
|
349 | 350 |
public void setDefaultValue(String defaultValue) { |
350 | 351 |
this.defaultValue = defaultValue; |
351 | 352 |
} |
352 |
|
|
353 |
|
|
353 | 354 |
public String getInterval() { |
354 | 355 |
return interval; |
355 | 356 |
} |
356 |
|
|
357 |
|
|
357 | 358 |
public void setInterval(String interval) { |
358 | 359 |
this.interval = interval; |
359 | 360 |
} |
360 |
|
|
361 |
|
|
361 | 362 |
public String getLabel() { |
362 | 363 |
return label; |
363 | 364 |
} |
364 | 365 |
public void setLabel(String label) { |
365 | 366 |
this.label = label; |
366 | 367 |
} |
367 |
|
|
368 |
|
|
368 | 369 |
public String getName() { |
369 | 370 |
return _name; |
370 | 371 |
} |
371 |
|
|
372 |
|
|
372 | 373 |
public void setName(String name) { |
373 | 374 |
this._name = name; |
374 | 375 |
} |
375 |
|
|
376 |
|
|
376 | 377 |
public ArrayList getSingleValues() { |
377 | 378 |
return singleValues; |
378 | 379 |
} |
379 |
|
|
380 |
|
|
380 | 381 |
public void addSingleValues(String singleValue) { |
381 | 382 |
this.singleValues.add(singleValue); |
382 | 383 |
} |
383 | 384 |
} |
384 | 385 |
|
385 | 386 |
public double getResX() { |
387 |
if (rg.offsetVector== null) |
|
388 |
return -1; |
|
386 | 389 |
return Math.abs(rg.offsetVector[0][0]); |
387 | 390 |
} |
388 |
|
|
391 |
|
|
389 | 392 |
public double getResY() { |
393 |
if (rg.offsetVector== null) |
|
394 |
return -1; |
|
395 |
|
|
390 | 396 |
return Math.abs(rg.offsetVector[1][1]); |
391 | 397 |
} |
392 | 398 |
|
... | ... | |
396 | 402 |
} |
397 | 403 |
|
398 | 404 |
} |
405 |
|
Also available in: Unified diff