geoplotlib icon indicating copy to clipboard operation
geoplotlib copied to clipboard

convexhull issue

Open pamdla opened this issue 7 years ago • 1 comments

Hi, I had this problem while using KMeansLayer: raise Exception('convexhull requires at least 3 points') how can I use it?

ps: my data file is a txt file, and it has three columns (id, lon, lat).

pamdla avatar Mar 13 '17 23:03 pamdla

convexhull does require at least 3 points

Try modifying kmeans.py

for l in set(labels):
        self.painter.set_color(self.cmap[l])
        if len(x[labels == l]) >= 3:
            self.painter.convexhull(x[labels == l], y[labels == l])
        self.painter.points(x[labels == l], y[labels == l], 2)

andrea-cuttone avatar Sep 24 '17 08:09 andrea-cuttone