Java源码示例:org.geotools.ows.ServiceException
示例1private static BufferedImage downloadWmsImage(GetMapRequest mapRequest, WebMapServer wms) throws IOException,
ServiceException {
GetMapResponse mapResponse = wms.issueRequest(mapRequest);
try (InputStream inputStream = mapResponse.getInputStream()) {
return ImageIO.read(inputStream);
}
}
private static WebMapServer getWmsServer(PropertySet configuration) throws IOException, ServiceException {
return new WebMapServer((URL) configuration.getValue(WmsLayerType.PROPERTY_NAME_URL));
}