st_clusterdbscan不可用,但Postgis安装在PostgreSQL上



我正在尝试在heroku/AWS postgresql实例上使用此处描述的postgis的st_clusterdbscan函数。在文档中,它说它从 2.3 开始可用并且需要 geos。Postgis 安装在带有 GEOS 的 V 2.4 中:

select postgis_version();
2.4 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
(1 row)

但是尝试使用该函数(SQL取自官方文档(给了我

SELECT ST_ClusterDBSCAN(location, eps := 50, minpoints := 2) over () AS cid                  
FROM users;
ERROR:  function st_clusterdbscan(geography, eps => integer, minpoints => integer) does not exist
LINE 1: SELECT ST_ClusterDBSCAN(location, eps := 50, minpoints := 2)...
^
HINT:  No function matches the given name and argument types. You 
might need to add explicit type casts.

我做错了什么?其他 postgis 功能(如 ST_DWITHIN(可用且有效。

这实际上是一个类型问题.eps需要转换为浮点,而我的"位置"需要转换为"几何",然后它起作用了。 谢谢大家。

最新更新