如何过滤/剪辑WMS提供的栅格

编程入门 行业动态 更新时间:2024-10-24 16:32:51
如何过滤/剪辑WMS提供的栅格 - Geoserver(How can I filter/clip a raster provided by WMS - Geoserver)

我正在尝试过滤/剪辑Geoserver提供的Web地图服务提供的栅格。

我不想基于多边形进行剪辑; 我想基于一个值进行过滤,使得低于此值的所有光栅像素都是黑色或透明的。

据我所知,我不能使用cql_filter,因为它仅用于WFS功能请求,而不能用于WMS Raster图像。

也许你知道如何解决我的问题。

I'm trying to filter/clip a raster provided by a Web Map Service from Geoserver.

I dont want to clip based on a polygon; I want to filter based on a value such that all raster pixels below this value are black or transparent.

As far as I know I can not use cql_filter since its only for WFS Feature Requests and not for WMS Raster images.

Maybe you have an idea how to solve my question.

最满意答案

WMS不会返回您的数据,它会返回您的数据图片

所以有两种可能性:

您使用Web Coverage Service(WCS)请求,它将返回栅格中的实际数据。 可以把它想象成栅格的WFS。 GeoServer手册涵盖了发出请求的机制, Demos下有一个请求构建器供您进行实验。 我很确定这只会允许您按矩形区域进行子集,尽管您的客户端可以自由地对返回的数据执行更复杂的操作。

您可以将此视为样式练习,在这种情况下,应该可以设置执行所需操作的SLD样式。 您将需要使用空间过滤器来剪切基础栅格,并根据其是真还是假来应用两个规则。 如果需要,您甚至可以将多边形作为环境变量传递给请求。

A WMS does not return you data, it returns a picture of your data.

So there are two possibilities:

You use a Web Coverage Service (WCS) request which will return you the actual data in your raster. Think of it as like a WFS for rasters. The GeoServer manual covers the mechanics of making a request and there is a request builder under Demos for you to experiment. I'm pretty sure this will only allow you to subset by rectangular areas, though your client is free to do more complex operations of the returned data.

You can consider this a styling exercise in which case it should be possible to set up an SLD style that performs the operation that you need. You will need to use a spatial filter to clip the underlying raster and apply two rules depending on if it is true or false. You can even pass the polygon in as an environment variable from the request if you need.

更多推荐

本文发布于:2023-07-30 23:43:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1340324.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:栅格   剪辑   WMS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!