【问题标题】:function force_2d(geometry) does not exist函数 force_2d(geometry) 不存在
【发布时间】:2022-07-20 22:05:11
【问题描述】:

我正在使用 Centos 7。安装了 PostgreSQL 和 PostGIS,我想使用 MapServer 显示地图文件到 openlayer。我还在我的数据库中添加了 PostGIS 扩展,但是当我调用已经有查询的地图文件时,没有错误。这是我的地图文件的内容

LAYER
METADATA
        "DESCRIPTION" "Border"
        "wms_title"   "Border"
        "wms_enable_request" "*"
        "ows_enable_request" "*"
    END
    
    PROJECTION
        'init=epsg:4326'
    END

    NAME "map_border"
    CONNECTIONTYPE postgis
    CONNECTION "user=# dbname=# host=# port=# password=#"
    #query
    DATA "geom FROM (SELECT st_geomfromtext(geom) as geom, gid FROM border) tmp using unique gid using srid=4326"
    TYPE POLYGON

    CLASS
        NAME "Border"
    END

    PROCESSING "CLOSE_CONNECTION=DEFER"

END

这里说 Postgresql reports the error as 'ERROR: function force_2d(geometry) does not exist,如果我检查 Postgre 数据库函数,它应该是 st_force_2d 而不是 ``force_2d``。

请帮助我解决错误或更改此功能?

谢谢

【问题讨论】:

  • 我会确保安装最新的 MapServer 版本(推荐 7.6.4)。可能是您使用的是非常旧的 MapServer 版本。

标签: postgresql openlayers postgis mapserver


【解决方案1】:

Même si je pense que tu as eu une réponse depuis le temps, j'ai été facesé à ce problème aujourd'hui, donc, pour ceux qui, comme moi, tomberont sur ta discussion en cherchant la solution, voici comment contourner coté postgis, en ajoutant une fonction st_force_2d qui appelle st_force2d : https://appgeodb.nancy.inra.fr/donnees/documentations/bdd/db_cefs/technique/Functions/st_force_2d_public.html

【讨论】:

  • sam,请用英文写下你的答案,因为 Stack Overflow 是English-only site
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-01-21
  • 1970-01-01
  • 1970-01-01
  • 2018-05-06
  • 2021-01-21
相关资源
最近更新 更多