您的位置:首页 > 汽车 > 新车 > Geoserver使用OGC过滤器PropertyIsLike无法读取PostGIS Jsonb类型

Geoserver使用OGC过滤器PropertyIsLike无法读取PostGIS Jsonb类型

2024/7/4 6:34:08 来源:https://blog.csdn.net/loveyou388i/article/details/139599697  浏览:    关键词:Geoserver使用OGC过滤器PropertyIsLike无法读取PostGIS Jsonb类型

错误提示:

code="internalEror"Rendering process falled, Layers: boylat shp_ 1 org,postgresq!.ut.PsQLException: ERRoR: function upperjisonb) does not existHint: No function matches the given name and arqument types, You might need to add explicit type castsPosition:447ERROR: function upper(jsonb)does not existHint: No function matches the given name and arqument types, You might need to add explicit type casts.Position:447

解决办法:使用JsonPointer Function函数

//jsonb示例
{"name": "city name","description": "the city description","districts": [{"name": "district1","population": 2000},{"name": "district2","population": 5000}]"population":{"average_age": 35,"toal": 50000}
}

使用方法:

jsonPointer(city, '/name').
jsonPointer(city, '/population/average_age').
jsonPointer(city, '/districts/0/name').

在OGC过滤器中可以这样使用:

<Rule><Name>Cities</Name><ogc:Filter><ogc:PropertyIsEqualTo><ogc:Function name="jsonPointer"><ogc:PropertyName>city</ogc:PropertyName><ogc:Literal>/population/average_age</ogc:Literal></ogc:Function><ogc:Literal>35</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter><PointSymbolizer><Graphic><Mark><WellKnownName>square</WellKnownName><Fill><CssParameter name="fill">#FF0000</CssParameter></Fill></Mark><Size>16</Size>   </Graphic></PointSymbolizer>
</Rule>

参考文档:Geoserver官方文档
中文文档

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com