Opened 8 years ago

Closed 8 years ago

#3617 closed defect (invalid)

ST_ClusterDbScan sometimes returns NULL cluster numbers

Reported by: robe Owned by: dbaston
Priority: blocker Milestone: PostGIS 2.3.0
Component: postgis Version: master
Keywords: Cc:

Description

In trying to troubleshoot issue #3612, I came across this other oddity.

SELECT ST_ClusterDBScan(geom,0,2) OVER()
FROM (SELECT ST_Point(10*i,2) As geom
FROM generate_series(1,10) i ) AS f;

Returns all nulls:

 st_clusterdbscan
------------------
             NULL
             NULL
             NULL
             NULL
             NULL
             NULL
             NULL
             NULL
             NULL
             NULL
(10 rows)

This is testing with:

POSTGIS="2.3.0dev r15043" GEOS="3.5.0-CAPI-1.9.0 r4090" PROJ="Rel. 4.9.1, 04 March 2015" GDAL="GDAL 2.1.0, released 2016/04/25" LIBXML="2.7.8" LIBJSON="0.12" RASTER PostgreSQL 9.5.2, compiled by Visual C++ build 1800, 64-bit

as well as

POSTGIS="2.3.0dev r15050" GEOS="3.5.0-CAPI-1.9.0 r4090" SFCGAL="1.3.0" PROJ="Rel. 4.9.1, 04 March 2015" GDAL="GDAL 2.1.0, released 2016/04/25" LIBXML="2.7.8" LIBJSON="0.12" (core procs from "2.3.0dev r15044" need upgrade) RASTER (raster procs from "2.3.0dev r15044" need upgrade) (sfcgal procs from "2.3.0dev r15044" need upgrade) PostgreSQL 9.6beta4, compiled by Visual C++ build 1800, 64-bit

and even testing under mingw

POSTGIS="2.3.0dev r15050" GEOS="3.5.0-CAPI-1.9.0 r4088" PROJ="Rel. 4.9.1, 04 March 2015" GDAL="GDAL 2.1.0, released 2016/04/25" LIBXML="2.7.8" LIBJSON="0.12" RASTER PostgreSQL 9.6beta4 on x86_64-w64-mingw32, compiled by gcc.exe (x86_64-win32-seh-rev1, Built by MinGW-W64 project) 4.8.3, 64-bit

I'm going to go thru my real data examples I've tested before to see what's up. I'm thinking this might have to do with recent changes in this function since last I tested.

Change History (4)

comment:1 by robe, 8 years ago

Owner: changed from pramsey to dbaston

comment:2 by dbaston, 8 years ago

This is intended; with a distance tolerance "eps" of zero and "minPoints" of 2, you need two or more identical points to form a cluster. Since all of the inputs are unique, there are no clusters.

comment:3 by dbaston, 8 years ago

See also #3567

comment:4 by robe, 8 years ago

Resolution: invalid
Status: newclosed

okay I'll dismiss this then. Didn't notice it was explained in the docs. Sorry for the noise :)

Note: See TracTickets for help on using tickets.