我正尝试在heroku / AWS postgresql实例上使用postgis描述的here的st_clusterdbscan-function。在文档中,它说它从2.3开始就可以使用,并且需要地理信息系统。postgis安装在带有geos的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,都是可用的,并且正在运行。
发布于 2018-09-06 15:52:07
实际上,这是一个类型问题。eps需要被强制转换为浮动,而我的“位置”需要被强制转换为“几何”,然后它就起作用了。谢谢大家。
https://stackoverflow.com/questions/52174194
复制相似问题