Hi,<div><br></div><div>when I delineate a basin using r.stream.basins, and convert the raster map of the basin into vector (r.to.vect), I sometimes get multiple polygons: i.e. one bigger and a couple of one cell polygons. (you can reproduce the behavior in NC sample dataset using <span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse;color:rgb(34,34,34)">easting=643677.87 northing=222800.246).</span></div>
<div><font color="#222222" face="arial, sans-serif"><span style="border-collapse:collapse">Since i need to remove the small polygons in a script, I would like to know whether I can use:</span></font></div>
<div><font color="#222222" face="arial, sans-serif"><span style="border-collapse:collapse"><br></span></font></div><div><font color="#222222" face="arial, sans-serif"><span style="border-collapse:collapse"><div>
grass.run_command('v.extract', list = 1,</div><div> input = v_basins,</div><div> output = v_basin,</div><div> type = 'area',</div>
<div> overwrite = True) </div><div><br></div><div>In fact, it seems to me that the bigger polygon is always listed as the first record. Is that always true? Does r.to.vect (feature=area) always list as first record the polygon with the larger area?</div>
<div>Or else, I should set a SQL query about the area. I've already tried something like:</div><div><br></div><div><div> grass.run_command('v.extract', where = 'area = max(area)', </div><div> input = v_basins, </div>
<div> output = v_basin, </div><div> type = 'area', </div><div> overwrite = True) </div></div><div><br>
</div><div>but it seems that the SQL statement is incorrect ... I'm not experienced with SQL.</div><div>Any idea?</div><div><br></div><div>Thanks,</div><div>madi</div><div><br></div><div><br></div></span></font></div>
<div><font color="#222222" face="arial, sans-serif"><span style="border-collapse:collapse"><br clear="all">
</span></font>
<div><br></div>-- <br><span style="color:rgb(102,102,102)">Ing. Margherita Di Leo, </span><span style="color:rgb(102,102,102)">Ph.D. </span><font color="#666666"><br></font><span style="color:rgb(102,102,102)"></span><br>
<br><br>
</div>