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官方文档
中文文档

相关推荐

  1. 使用python读取类型文件夹中的文档内容】

    2024-06-12 09:00:04       13 阅读
  2. 过滤器的简单使用

    2024-06-12 09:00:04       42 阅读
  3. Filter过滤器学习使用

    2024-06-12 09:00:04       27 阅读
  4. Qt使用事件过滤器

    2024-06-12 09:00:04       14 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-06-12 09:00:04       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-06-12 09:00:04       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-06-12 09:00:04       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-06-12 09:00:04       18 阅读

热门阅读

  1. Web前端教程165:深入探索Web前端技术的奥秘

    2024-06-12 09:00:04       9 阅读
  2. Unity3D MMORPG背包系统数据获取与通讯详解

    2024-06-12 09:00:04       8 阅读
  3. 设计模式之外观模式

    2024-06-12 09:00:04       10 阅读
  4. pyautogui 等待元素出现的方法

    2024-06-12 09:00:04       10 阅读
  5. app-ios 内嵌h5的缓存问题

    2024-06-12 09:00:04       5 阅读
  6. 简单聊聊Vue

    2024-06-12 09:00:04       10 阅读
  7. 微信小程序·审核

    2024-06-12 09:00:04       9 阅读