具有功能 ID 的地理服务器跨层 cql 过滤器

geoserver cross-layer cql filter with feature id

我想获取与 B 层中特定特征相交的 A 层特征(使用 B 层特征的 ID)。以下是我的查询:

localhost:8080/geoserver/wms?LAYERS=sf:roads,sf:restricted,sf:bugsites&STYLES=&FORMAT=image/png&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application/vnd.ogc.se_inimage&SRS=EPSG:26713&CQL_FILTER=INCLUDE;INCLUDE;INTERSECTS(the_geom, querySingle('sf:restricted', 'the_geom','IN('restricted.4')'))&BBOX=589081.6705629,4914128.1213261,609174.02430924,4928177.0717971&WIDTH=512&HEIGHT=358

但无法解析查询,我收到此错误:

问题出在从第二层获取特征的查询中 (querySingle('sf:restricted', 'the_geom','IN('restricted.4')'))

第三个参数应该是where 子句,包括字段名称和所需的值。当您要查找单个 ID 时,它可能是 'ID=4'

看看 example pagesf:restricted 的 ID 字段是 cat

querySingle('sf:restricted', 'the_geom','cat = 4')

终于修好了... 我在 id 周围使用了两个单引号,效果很好:| (一个双引号不起作用)。

INTERSECTS(the_geom, querySingle('sf:restricted', 'the_geom','IN(''restricted.4'')'))