Closes #4188
Closes https://github.com/postgis/postgis/pull/309
git-svn-id: http://svn.osgeo.org/postgis/trunk@16860
b70326c6-7e19-0410-871a-
916f4a2858ee
- #4176, ST_Intersects supports GEOMETRYCOLLECTION (Darafei Praliaskouski)
- #4181, St_AsMVTGeom: Avoid type changes due to validation (Raúl Marín)
- #4183, St_AsMVTGeom: Drop invalid geometries after simplification (Raúl Marín)
+ - #4188, Avoid division by zero in kmeans (Raúl Marín)
PostGIS 2.5.0
2018/09/23
}
for (i = 0; i < k; i++)
{
- centers[i]->x /= weights[i];
- centers[i]->y /= weights[i];
+ if (weights[i])
+ {
+ centers[i]->x /= weights[i];
+ centers[i]->y /= weights[i];
+ }
}
}