【问题标题】:Mapserver/PostGIS FILTER Query ErrorMapserver/PostGIS FILTER 查询错误
【发布时间】:2017-02-27 12:50:05
【问题描述】:

我是新使用 mapsever。我从 Internet (http://www.codegeo.com.br/search/label/MapServer) 下载了一个示例。我在我的 PC、我的开发环境(mapserver 版本 6.4.1)中对其进行了测试,它可以工作。

现在我把它放在“测试环境”中(mapserver 版本 7.0.0),但是我在 mapfile 中的 FILTER 指令有问题。

这是.map文件中的代码:

DATA "the_geom FROM estados USING UNIQUE id USING SRID=4326"
FILTER "sigla ILIKE '%%state%%'"

当我执行脚本时,我得到一个空的 png 文件,但没有错误:

$ mapserv -nh "QUERY_STRING=map=/var/www/codegeo/codegeo.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=states&estado=SP&WIDTH=256&HEIGHT=256&CRS=EPSG%3A900913&STYLES=&BBOX=0%2C0%2C2504688.5428486555%2C2504688.5428486555"

mapfile文件中定义的日志文件有如下错误:

executing query: select "nome","codigo",encode(ST_AsBinary(ST_Force2D("the_geom"),'NDR'),'hex') as geom,"id" from estados where the_geom && ST_GeomFromText('POLYGON((0.0439453124999988 0.0439453081913454,0.0439453124999988 21.9022779666686,22.4560546875 21.9022779666686,22.4560546875 0.0439453081913454,0.0439453124999988 0.0439453081913454))',4326) and () [Mon Feb 27 11:39:06 2017].147993 msPostGISLayerWhichShapes(): Query error. Error executing query. Check server logs [Mon Feb 27 12:05:49 2017].361015 getSymbol(): Symbol definition error. Parsing error near (():(line 123) [Mon Feb 27 11:39:06 2017].147993 msPostGISLayerWhichShapes(): Query error. Error executing query. Check server logs [Mon Feb 27 12:05:49 2017].361015 getSymbol(): Symbol definition error. Parsing error near (():(line 123)

我知道过滤器指令有问题。如果我评论它,我会在网页中看到该图层。我没有找到任何关于 ILIKE 运算符的文档。

有人知道是哪个问题吗?

【问题讨论】:

    标签: postgis mapserver


    【解决方案1】:

    从 Mapserver 7 开始,您不能再使用“原生过滤器”了。

    在此处查看文档 http://mapserver.org/de/mapfile/layer.html(在 FILTER 下)。

    您需要使用此处记录的表达式语法重写过滤器http://mapserver.org/de/mapfile/expressions.html#expressions

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-18
      • 2020-07-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多