Revision 4606 trunk/libraries/libRemoteServices/src/org/gvsig/remoteClient/wcs/WCSProtocolHandler.java
WCSProtocolHandler.java | ||
---|---|---|
141 | 141 |
e.printStackTrace(); |
142 | 142 |
} |
143 | 143 |
try { |
144 |
File f = com.iver.andami.Utilities.downloadFile(request,"wcs_capabilities.xml");
|
|
144 |
File f = com.iver.andami.Utilities.downloadFile(request, "wcs_describeCoverage.xml");
|
|
145 | 145 |
parseDescribeCoverage(f); |
146 | 146 |
} catch(Exception e) { |
147 | 147 |
e.printStackTrace(); |
... | ... | |
156 | 156 |
//pass this buildXXXRequest to the WCSProtocolHandlerXXX: The request can depend on the WCS version. |
157 | 157 |
request = new URL(buildCoverageRequest(status)); |
158 | 158 |
|
159 |
File f = com.iver.andami.Utilities.downloadFile(request, "wcsGetMap");
|
|
159 |
File f = com.iver.andami.Utilities.downloadFile(request, "wcsGetCoverage");
|
|
160 | 160 |
|
161 | 161 |
if (Utilities.isTextFile(f)) { |
162 | 162 |
FileInputStream fis = new FileInputStream(f); |
... | ... | |
219 | 219 |
onlineResource = status.getOnlineResource(); |
220 | 220 |
symbol = getSymbol(onlineResource); |
221 | 221 |
|
222 |
req.append(onlineResource + symbol + "REQUEST=GetMap&SERVICE=WCS&VERSION=").append(getVersion()).append("&");
|
|
222 |
req.append(onlineResource + symbol + "service=WCS&version=").append(getVersion()).append("&request=GetCoverage&");
|
|
223 | 223 |
req.append(getPartialQuery(status)); |
224 |
if (status.getExceptionFormat() != null) {
|
|
225 |
req.append("&EXCEPTIONS=" + status.getExceptionFormat());
|
|
226 |
} else {
|
|
227 |
req.append("&EXCEPTIONS=XML");
|
|
228 |
}
|
|
224 |
if (status.getExceptionFormat() != null) {
|
|
225 |
req.append("&EXCEPTIONS=" + status.getExceptionFormat());
|
|
226 |
} else {
|
|
227 |
req.append("&EXCEPTIONS=XML");
|
|
228 |
}
|
|
229 | 229 |
return req.toString().replaceAll(" ", "%20"); |
230 | 230 |
} |
231 | 231 |
|
... | ... | |
236 | 236 |
public String getPartialQuery(WCSStatus status) |
237 | 237 |
{ |
238 | 238 |
StringBuffer req = new StringBuffer(); |
239 |
req.append("COVERAGE=" + status.getCoverageName()) |
|
240 |
.append("&SRS=" + status.getSrs()) |
|
241 |
.append("&BBOX=" + status.getExtent().getMinX()+ "," ) |
|
242 |
.append(status.getExtent().getMinY()+ ",") |
|
243 |
.append(status.getExtent().getMaxX()+ ",") |
|
244 |
.append(status.getExtent().getMaxY()) |
|
245 |
.append("&WIDTH=" + status.getWidth()) |
|
246 |
.append("&HEIGHT=" + status.getHeight()) |
|
239 |
req.append( (status.getTime() != null) ? "TIME="+status.getTime() : "" ) |
|
240 |
.append( "&COVERAGE=" + status.getCoverageName()) |
|
241 |
.append ("&CRS=" + status.getSrs()) |
|
242 |
.append( "&FORMAT=" + status.getFormat() ) |
|
243 |
.append( "&HEIGHT=" + status.getHeight()) |
|
244 |
.append( "&WIDTH=" + status.getWidth()) |
|
247 | 245 |
.append( (status.getDepth() != null) ? "&DEPTH="+status.getDepth().intValue() : "" ) |
248 |
.append( (status.getTime() != null) ? "&TIME="+status.getTime() : "" ) |
|
246 |
.append( "&BBOX=" + status.getExtent().getMinX()+ "," ) |
|
247 |
.append( status.getExtent().getMinY()+ ",") |
|
248 |
.append( status.getExtent().getMaxX()+ ",") |
|
249 |
.append( status.getExtent().getMaxY()) |
|
249 | 250 |
.append( (status.getParameters() != null) ? "&"+status.getParameters() : ""); |
250 | 251 |
|
251 | 252 |
return req.toString(); |
Also available in: Unified diff