【问题标题】:GeoTools getCapabilities with no CRS in boundingbox边界框中没有 CRS 的 GeoTools getCapabilities
【发布时间】: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 存在/遇到问题,以便查看是否需要提交错误或升级等。
  • 好的。我会试着找到这个。不再做这个了。

标签: geotools mapserver


【解决方案1】:

您需要提交bug report with the MapServer team。 CRS 是强制性元素,您不能将其留空并期望使边界框有意义。在理想情况下,GeoTools 可以依靠 Ex_GeographicBoundingBox,但这在这里也无济于事。

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

【讨论】:

    猜你喜欢
    • 2011-08-24
    • 2014-06-21
    • 1970-01-01
    • 2023-03-22
    • 2018-11-07
    • 1970-01-01
    • 2012-11-13
    • 2020-08-28
    • 2017-12-23
    相关资源
    最近更新 更多