Revision 3325 org.gvsig.raster.wms/trunk/org.gvsig.raster.wms/org.gvsig.raster.wms.remoteclient/src/main/java/org/gvsig/remoteclient/wms/wms_1_3_0/request/WMSGetFeatureInfoRequest1_1_3.java
WMSGetFeatureInfoRequest1_1_3.java | ||
---|---|---|
28 | 28 |
|
29 | 29 |
import org.gvsig.compat.CompatLocator; |
30 | 30 |
import org.gvsig.compat.lang.StringUtils; |
31 |
import org.gvsig.remoteclient.epsg.CrsAxisOrder; |
|
31 | 32 |
import org.gvsig.remoteclient.utils.CapabilitiesTags; |
32 | 33 |
import org.gvsig.remoteclient.utils.Utilities; |
33 | 34 |
import org.gvsig.remoteclient.wms.WMSProtocolHandler; |
... | ... | |
43 | 44 |
|
44 | 45 |
public WMSGetFeatureInfoRequest1_1_3(WMSStatus status, |
45 | 46 |
WMSProtocolHandler protocolHandler, int x, int y) { |
46 |
super(status, protocolHandler, x, y); |
|
47 |
super(status, protocolHandler, x, y); |
|
48 |
if (status!=null && status.getSrs()!=null) { |
|
49 |
if (!status.isXyAxisOrder() && !CrsAxisOrder.isXyAxisOrder(status.getSrs())) { |
|
50 |
this.x = y; |
|
51 |
this.y = x; |
|
52 |
} |
|
53 |
} |
|
47 | 54 |
} |
48 | 55 |
|
49 | 56 |
/* |
... | ... | |
55 | 62 |
req.append(onlineResource); |
56 | 63 |
req.append("REQUEST=GetFeatureInfo&SERVICE=WMS&"); |
57 | 64 |
req.append("QUERY_LAYERS=").append(Utilities.Vector2CS(status.getLayerNames())); |
58 |
//req.append("&VERSION=").append(protocolHandler.getVersion()).append("&INFO_FORMAT=application/vnd.ogc.gml&"); |
|
59 | 65 |
req.append("&VERSION=").append(protocolHandler.getVersion()).append("&INFO_FORMAT=" + status.getInfoFormat() + "&"); |
60 | 66 |
req.append(getPartialQuery(status)).append("&I="+ x + "&J=" + y); |
61 | 67 |
req.append("&FEATURE_COUNT=10000"); |
... | ... | |
69 | 75 |
*/ |
70 | 76 |
protected String getPartialQuery(WMSStatus status) { |
71 | 77 |
StringBuffer req = new StringBuffer(); |
78 |
double coord1, coord2, coord3, coord4; |
|
79 |
String epsgCode = status.getSrs(); |
|
80 |
if (status.isXyAxisOrder() || CrsAxisOrder.isXyAxisOrder(epsgCode)) { |
|
81 |
coord1 = status.getExtent().getMinX(); |
|
82 |
coord2 = status.getExtent().getMinY(); |
|
83 |
coord3 = status.getExtent().getMaxX(); |
|
84 |
coord4 = status.getExtent().getMaxY(); |
|
85 |
} |
|
86 |
else { |
|
87 |
// use reverse coordinate order as defined by EPSG registry |
|
88 |
coord1 = status.getExtent().getMinY(); |
|
89 |
coord2 = status.getExtent().getMinX(); |
|
90 |
coord3 = status.getExtent().getMaxY(); |
|
91 |
coord4 = status.getExtent().getMaxX(); |
|
92 |
} |
|
93 |
|
|
94 |
|
|
72 | 95 |
req.append("LAYERS=" + Utilities.Vector2CS(status.getLayerNames())) |
73 | 96 |
.append("&CRS=" + status.getSrs()) |
74 |
.append("&BBOX=" + status.getExtent().getMinX()+ "," )
|
|
75 |
.append(status.getExtent().getMinY()+ ",")
|
|
76 |
.append(status.getExtent().getMaxX()+ ",")
|
|
77 |
.append(status.getExtent().getMaxY())
|
|
97 |
.append("&BBOX=" + coord1 + "," )
|
|
98 |
.append(coord2 + ",")
|
|
99 |
.append(coord3 + ",")
|
|
100 |
.append(coord4)
|
|
78 | 101 |
.append("&WIDTH=" + status.getWidth()) |
79 | 102 |
.append("&HEIGHT=" + status.getHeight()) |
80 | 103 |
.append("&FORMAT=" + status.getFormat()) |
Also available in: Unified diff