边界框中没有CRS的GeoTools getCapabilities

时间:2019-02-20 15:00:37

标签: geotools mapserver

我正试图从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功能就是这样(重要部分):

enter image description here

如我所见,边界框实际上没有CRS,但由于它不是我的服务器,因此我对此无能为力。

我该如何进行?

1 个答案:

答案 0 :(得分:0)

您需要提交bug report with the MapServer teamCRS是必填元素,您不能将其保留为空白并期望使边界框有意义。在理想情况下,GeoTools可能会退回到Ex_GeographicBoundingBox上,但这在这里也无济于事。

还值得联系服务器所有者并要求他们修复该层的配置。

相关问题