Revision 3325 org.gvsig.raster.wms/trunk/org.gvsig.raster.wms/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/WMSServerExplorerParameters.java
WMSServerExplorerParameters.java | ||
---|---|---|
44 | 44 |
protected static final String FIELD_HOST = "host"; |
45 | 45 |
protected static DynClass DYNCLASS = null; |
46 | 46 |
private DelegatedDynObject delegatedDynObject = null; |
47 |
private static final String AXIS_ORDER = "axisorder";
|
|
47 |
private static final String FIELD_XYAXISORDER = "xyaxisorder";
|
|
48 | 48 |
|
49 | 49 |
public WMSServerExplorerParameters() { |
50 | 50 |
super(); |
... | ... | |
72 | 72 |
|
73 | 73 |
AbstractRasterDataParameters.registerDynClass(definition); |
74 | 74 |
|
75 |
definition.addDynFieldBoolean(AXIS_ORDER)
|
|
75 |
definition.addDynFieldBoolean(FIELD_XYAXISORDER)
|
|
76 | 76 |
.setDescription("Longitude first in axis order") |
77 | 77 |
.setMandatory(false); |
78 | 78 |
|
... | ... | |
113 | 113 |
public String getExplorerName() { |
114 | 114 |
return WMSServerExplorer.NAME; |
115 | 115 |
} |
116 |
|
|
116 |
|
|
117 | 117 |
/** |
118 |
* Returns true if the longitude is first in axis order |
|
118 |
* <p>Gets the behaviour of the WMS client with regards the axis order</p> |
|
119 |
* |
|
120 |
* <p>Returns <code>true</code> if the WMS parser should assume that the |
|
121 |
* order of the coordinates follows the XY axis order |
|
122 |
* (the first coordinate corresponds to the horizontal X |
|
123 |
* axis, while the second coordinate corresponds to the |
|
124 |
* vertical Y axis), regardless the protocol version and CRS in use.</p> |
|
125 |
* |
|
126 |
* <p>Returns <code>false</code> if the WMS parser should decide the |
|
127 |
* axis order based on the protocol version and the coordinate |
|
128 |
* reference system (CRS) in use. In particular, if protocol |
|
129 |
* version is >= 1.3.0, then the WMS parser assumes |
|
130 |
* the axis order defined in the official EPSG registry for the |
|
131 |
* CRS in use. For versions < 1.3.0, the XY axis order is assumed.</p> |
|
132 |
* |
|
133 |
* <p>The default value is <code>false</code></p>. |
|
134 |
* @see #setXyAxisOrder(boolean) |
|
119 | 135 |
* @return |
120 | 136 |
*/ |
121 |
public boolean isLongitudeFirst() { |
|
122 |
Object obj = getDynValue(AXIS_ORDER); |
|
123 |
if(obj instanceof Boolean) { |
|
124 |
Boolean b = (Boolean)getDynValue(AXIS_ORDER); |
|
125 |
if(b != null) |
|
126 |
return ((Boolean)b).booleanValue(); |
|
137 |
public boolean isXyAxisOrder() { |
|
138 |
if (hasDynValue(FIELD_XYAXISORDER)) { |
|
139 |
Object obj = getDynValue(FIELD_XYAXISORDER); |
|
140 |
if(obj instanceof Boolean) { |
|
141 |
Boolean b = (Boolean)getDynValue(FIELD_XYAXISORDER); |
|
142 |
if(b != null) |
|
143 |
return ((Boolean)b).booleanValue(); |
|
144 |
} |
|
145 |
if(obj instanceof String) { |
|
146 |
String b = (String)getDynValue(FIELD_XYAXISORDER); |
|
147 |
if(b != null) |
|
148 |
return new Boolean(((String)b)); |
|
149 |
} |
|
127 | 150 |
} |
128 |
if(obj instanceof String) { |
|
129 |
String b = (String)getDynValue(AXIS_ORDER); |
|
130 |
if(b != null) |
|
131 |
return new Boolean(((String)b)); |
|
132 |
} |
|
133 | 151 |
return false; |
134 | 152 |
} |
135 |
|
|
153 |
|
|
136 | 154 |
/** |
137 |
* Sets the longitude first in axis order |
|
138 |
* @param longFirst |
|
155 |
* <p>Sets the behaviour of the WMS client with regards the axis order.<p> |
|
156 |
* |
|
157 |
* <p>If set to <code>true</code>, then the XY axis order |
|
158 |
* is assumed for all the WMS |
|
159 |
* protocol versions and coordinate reference systems.</p> |
|
160 |
* |
|
161 |
* <p>If set to <code>false</code> |
|
162 |
* then the WMS parser will decide the axis order based on |
|
163 |
* the protocol version and the coordinate reference system (CRS) |
|
164 |
* in use. In particular, if protocol |
|
165 |
* version is >= 1.3.0, then the WMS parser assumes |
|
166 |
* the axis order defined in the official EPSG registry for the |
|
167 |
* CRS in use. For versions < 1.3.0, the XY axis order is assumed.</p> |
|
168 |
* |
|
169 |
* |
|
170 |
* @param assumeXY |
|
171 |
* @see #isXyAxisOrder() |
|
139 | 172 |
*/ |
140 |
public void setLongitudeFirst(boolean longFirst) {
|
|
141 |
this.setDynValue(AXIS_ORDER, new Boolean(longFirst));
|
|
173 |
public void setXyAxisOrder(boolean assumeXY) {
|
|
174 |
this.setDynValue(FIELD_XYAXISORDER, new Boolean(assumeXY));
|
|
142 | 175 |
} |
143 | 176 |
} |
Also available in: Unified diff