<div dir="ltr"><div><div><div><div><div><div><div><div>Hey,<br></div>your question is to imprecise to get a good answer (better have a schema / test case, and better describe your problems).<br><br></div>If you mean : given a set of points, find the 5 polygons that have the same number of points (up to 1 if n_points%5 !=0), adding possibly a constraint on there shape (polygons should be more or less smoth for instance), it is a very hard problem.<br>
</div>You can try to solve it by graphcut for instance, or any other optimization algorithms. This kind of solutions are way beyond postgis.<br><br></div>Now if your points have a more or less predictable distribution with nice features, you could use the kmeans algorithm to cluster your points into 5 groups, then generate the envelope (alpha shape) of each group.<br>
<br></div><div>You could also use the property of voronoi cells and iteratively merge it (region growing).<br></div><div><br></div>If your point distribution is very regular, you could use very basic geometric approach like drawing a pentagon over your points and split it in 5 equal parts<br>
</div>, hoping that they will contain the correct number of points.<br><br></div>Either way what you want is called "clustering" and you can use many different approaches, depending on your data and requierement (<a href="http://en.wikipedia.org/wiki/Cluster_analysis">http://en.wikipedia.org/wiki/Cluster_analysis</a>).<br>
<br></div>Cheers,<br>Rémi-C<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-06-23 12:58 GMT+02:00  <span dir="ltr"><<a href="mailto:kinju59@gmail.com" target="_blank">kinju59@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>



<div>
<div>
<div>Hello all,</div>
<div> </div>
<div>I have a geographic zone containing points, and I would like obtain 5 
polygons containing each of them the same (+/-) number of points.</div>
<div> </div>
<div>Sometime a polygon will be small, sometime it will big, but both will 
contain +/- the same number of points they contain.</div>
<div> </div>
<div>Is it possible to do that with Postgis ?</div>
<div> </div>
<div>Thank you for your help,</div>
<div> </div>
<div>kin</div></div></div>
<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>