Postgis功能并不是唯一的

时间:2013-12-10 06:49:02

标签: sql postgresql drupal postgis cartaro

我正在尝试cartaro,尝试创建空间对象时出错。错误消息是

Unable to parse WKT: POLYGON((2323165.9017765 -3715665.1528316,2325153.2645117 -3715818.0268882,2323471.6498896 -3717652.5155667,2323165.9017765 -3715665.1528316))

查看postgres日志,我看到数据库错误是

ERROR:  function st_geometrytype(unknown) is not unique at character 8
HINT:  Could not choose a best candidate function. You might need to add explicit type casts.
STATEMENT:  SELECT ST_GeometryType('POLYGON((2323165.9017765 -3715665.1528316,2325153.2645117 -3715818.0268882,2323471.6498896 -3717652.5155667,2323165.9017765 -3715665.1528316))'), ST_IsValid('POLYGON((2323165.9017765 -3715665.1528316,2325153.2645117 -3715818.0268882,2323471.6498896 -3717652.5155667,2323165.9017765 -3715665.1528316))'), ST_IsValidReason('POLYGON((2323165.9017765 -3715665.1528316,2325153.2645117 -3715818.0268882,2323471.6498896 -3717652.5155667,2323165.9017765 -3715665.1528316))') as reason

如果我尝试手动运行该语句的简化版本,我会得到

# SELECT ST_GeometryType('POINT(10 10)');
ERROR:  function st_geometrytype(unknown) is not unique
LINE 1: SELECT ST_GeometryType('POINT(10 10)');
               ^
HINT:  Could not choose a best candidate function. You might need to add explicit type casts.

然而,

# SELECT ST_GeometryType(ST_GeometryFromText('POINT(10 10)'));
 st_geometrytype 
-----------------
 ST_Point
(1 row)

看起来cartaro正在查询错误并省略St_GeometryFromText,但看起来奇怪的是它会出现如此明显的错误。这可能与我正在使用的PostGIS版本(2.1.0)有关,还是这只是一个错误?

修改

# \df ST_GeometryType
                              List of functions
  Schema  |      Name       | Result data type | Argument data types |  Type  
----------+-----------------+------------------+---------------------+--------
 public   | st_geometrytype | text             | geometry            | normal
 topology | st_geometrytype | text             | tg topogeometry     | normal
(2 rows)

看起来有两个与该名称匹配的函数,是否应删除?

0 个答案:

没有答案