]> granicus.if.org Git - postgis/commitdiff
Fix KMeans initialization issue that lost clusters sometimes.
authorDarafei Praliaskouski <me@komzpa.net>
Tue, 2 Jan 2018 14:06:27 +0000 (14:06 +0000)
committerDarafei Praliaskouski <me@komzpa.net>
Tue, 2 Jan 2018 14:06:27 +0000 (14:06 +0000)
Closes #3965
Closes https://github.com/postgis/postgis/pull/179

git-svn-id: http://svn.osgeo.org/postgis/branches/2.4@16213 b70326c6-7e19-0410-871a-916f4a2858ee

NEWS
liblwgeom/lwkmeans.c

diff --git a/NEWS b/NEWS
index 738f48fe9ca197a777c2bbe3df9796ca8074b606..3df658729e3e8e8528c4cc349480adc8d8380a4a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,11 +1,13 @@
 PostGIS 2.4.3
-2017/xx/xx
+2018/xx/xx
 
  * Bug fixes *
   - #3713, Support encodings that happen to output a '\' character
   - #3827, Set configure default to not do interrupt testing,
-          was causing false negatives for many people
+           was causing false negatives for many people
   - #3930, Minimum bounding circle issues on 32-bit platforms
+  - #3965, ST_ClusterKMeans used to lose some clusters on initialization
+           (Darafei Praliaskouski)
 
  * Enhancements *
   - #3944, Update to EPSG register v9.2 (Even Rouault)
index e7f576048fcd6e94a208a6a6f518defdc2d5f00b..d92c41aed7aa65bb8b81db89be7a038e523760a3 100644 (file)
@@ -201,6 +201,7 @@ lwgeom_cluster_2d_kmeans(const LWGEOM **geoms, int ngeoms, int k)
                        if (seen[j] == closest)
                        {
                                closest = (closest + 1) % config.num_objs;
+                               j = 0;
                        }
                        else
                        {