[postgis-tickets] r16214 - Fix KMeans initialization issue that lost clusters sometimes.

Darafei komzpa at gmail.com
Tue Jan 2 06:09:51 PST 2018


Author: komzpa
Date: 2018-01-02 06:09:50 -0800 (Tue, 02 Jan 2018)
New Revision: 16214

Modified:
   branches/2.3/NEWS
   branches/2.3/liblwgeom/lwkmeans.c
Log:
Fix KMeans initialization issue that lost clusters sometimes.

Closes #3965
Closes https://github.com/postgis/postgis/pull/179



Modified: branches/2.3/NEWS
===================================================================
--- branches/2.3/NEWS	2018-01-02 14:06:27 UTC (rev 16213)
+++ branches/2.3/NEWS	2018-01-02 14:09:50 UTC (rev 16214)
@@ -1,11 +1,12 @@
 PostGIS 2.3.6
-2017/xx/xx
+2018/xx/xx
 
   * Bug Fixes and Enhancements
 
   - #3713, Support encodings that happen to output a '\' character
+  - #3965, ST_ClusterKMeans used to lose some clusters on initialization
+           (Darafei Praliaskouski)
 
-
 PostGIS 2.3.5
 2017/11/15
 

Modified: branches/2.3/liblwgeom/lwkmeans.c
===================================================================
--- branches/2.3/liblwgeom/lwkmeans.c	2018-01-02 14:06:27 UTC (rev 16213)
+++ branches/2.3/liblwgeom/lwkmeans.c	2018-01-02 14:09:50 UTC (rev 16214)
@@ -194,6 +194,7 @@
 			if (seen[j] == closest)
 			{
 				closest = (closest + 1) % config.num_objs;
+				j = 0;
 			}
 			else
 			{



More information about the postgis-tickets mailing list