【问题标题】:Function createtopology(unknown, integer, integer) does not exist. Not able run PostGIS function in Postgres函数 createtopology(unknown, integer, integer) 不存在。无法运行 PostGIS 功能
【发布时间】:2022-10-13 00:58:33
【问题描述】:

我正在尝试运行此功能

SELECT public.CreateTopology('topo1',4326,0); 

这给了我

ERROR:  function public.createtopology(unknown, integer, integer) does not exist
LINE 1: select public.CreateTopology('topo1',4326,0);
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
SQL state: 42883
Character: 8

我可以毫无问题地使用其他 PostGIS 功能。然而,这个不起作用。请注意,我的数据库中有很多方案。这是为什么?

【问题讨论】:

  • According to the manual第三个参数需要为double,试试:CreateTopology('topo1',4326,0::double precision)

标签: postgresql postgis


【解决方案1】:

第三个参数是可选的,但如果存在是数据类型double precision,如果省略默认为0。(见Postgis documentation CreateTopology。所以试试

SELECT public.CreateTopology('topo1',4326,0::double precision);
          OR 
SELECT public.CreateTopology('topo1',4326,0.0); 
          OR
SELECT public.CreateTopology('topo1',4326);

更新:正如发布的'topo1' 是一个字符串文字。但它必须是Topology。您需要更正数据类型。

【讨论】:

  • 那不工作......同样的错误
  • 更新了答案并更正了链接。您的数据类型不正确。
  • 对不起,我不明白。 topo1 必须是 varchar topology_schema_name... 基本上是 string。这是怎么回事?
  • 对不起,我的误读。
猜你喜欢
  • 2021-02-03
  • 2013-04-07
  • 1970-01-01
  • 2019-11-12
  • 2021-12-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多