【发布时间】:2019-07-14 07:37:03
【问题描述】:
我正在尝试从 MapServer 检索功能:
URL url = null;
try {
url = new URL( sourceUrl );
} catch (MalformedURLException e) {
//will not happen
}
WebMapServer wms = null;
try {
wms = new WebMapServer(url);
WMSCapabilities capabilities = wms.getCapabilities();
String serverName = capabilities.getService().getName();
String serverTitle = capabilities.getService().getTitle();
System.out.println("Capabilities retrieved from server: " + serverName + " (" + serverTitle + ")");
} catch (Exception e) {
e.printStackTrace();
}
但我收到此错误:
Caused by: org.xml.sax.SAXException: Bounding Box element contains no CRS/SRS attribute
at org.geotools.ows.wms.xml.WMSComplexTypes$_BoundingBoxType.getValue(WMSComplexTypes.java:3241)
at org.geotools.xml.handlers.ComplexElementHandler.endElement(ComplexElementHandler.java:140)
at org.geotools.xml.XMLSAXHandler.endElement(XMLSAXHandler.java:252)
... 87 more
XML 的能力是这样的(重要的部分):
正如我所见,边界框实际上没有 CRS,但我对此无能为力,因为它不是我的服务器。
我该如何继续?
【问题讨论】:
-
这是什么版本的地图服务器?它会在 GetCapabilities 响应的顶部显示
-
@user27874 谢谢,但它不再相关。已经找到解决方法。
-
很高兴您有一个解决方法,但仍然很高兴知道哪个版本的 MapServer 存在/遇到问题,以便查看是否需要提交错误或升级等。
-
好的。我会试着找到这个。不再做这个了。