简体   繁体   English

OpenLayers4/ JavaScript:有没有办法获得 ImageWMS 层的所有功能?

[英]OpenLayers4/ JavaScript: Is ther a way to get all features of an ImageWMS layer?

I want to search a layer for specific properties, so i want to get all features info of the layer for the whole map not for a specific coordinate.我想搜索特定属性的图层,所以我想获取整个地图的图层的所有特征信息,而不是特定坐标。 For a certain point i use getGetFeatureInfoUrl .对于某一点,我使用getGetFeatureInfoUrl Is there a function to get features for the whole layer?是否有获取整个层特征的函数?

You simply can't or not this way around at least.至少你不能或不能这样。

You have two choices to maybe bypass the issue depending of your goal(s):根据您的目标,您有两种选择可以绕过该问题:

  • If it's just about rendering layer, you can use SLD to style WMS to render WMS only matching you criteria(s).如果它只是关于渲染层,您可以使用 SLD 来设置 WMS 样式以仅渲染符合您的条件的 WMS。 Default WMS layer could be a river with a column river_width.默认的 WMS 图层可以是带有 river_width 列的河流。 You could only display the layer with river_width > 5m using SLD.您只能使用 SLD 显示 river_width > 5m 的图层。 However, you will not get the properties except some of them when clicking (like you already do with WMS GetFeatureInfo)但是,单击时除了其中一些属性之外,您将不会获得属性(就像您已经使用 WMS GetFeatureInfo 所做的那样)

  • If you really want the properties, you may call the WFS endpoint if the WMS layer you use is also available through WFS.如果您确实需要这些属性,并且您使用的 WMS 层也可通过 WFS 获得,则您可以调用 WFS 端点。 In this case, you will use WFS with Filter Encoding or CQL/ECQL filter (only available in GeoServer).在这种情况下,您将使用 WFS 和过滤器编码或 CQL/ECQL 过滤器(仅在 GeoServer 中可用)。 If there are too many results or the geometry are too big, it may overload the server or take it to long to return the result.如果结果太多或几何体太大,可能会导致服务器过载或需要很长时间才能返回结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM