The one-cell areas are correct, at least within the logic of vector
topology. If you used r.to.vect with the -v flag, the one-cell areas
will have the same category like the neighboring areas belonging to
the same basin, that is, area calculations for basins done with
v.to.db will be correct and all areas belonging to the same basin will
share the same category (row in the attribute table).

If you want to remove one-cell areas with v.clean tool=rmarea, the
threshold should obviously be larger than the area of one cell (nsres
* ewres) of the original raster and smaller than two cells (2 * nsres
* ewres).

If you want to get rid of entries in the attribute table that are no
longer linked to a vector feature, you can use v.extract layer=1
type=area for areas in layer 1 or alternatively check the min and max
category values with v.category op=report and then v.extract
list=min-max.

Markus M


On Mon, Apr 9, 2012 at 7:35 PM, Margherita Di Leo
<dileomargher...@gmail.com> wrote:
>
>
> On Mon, Apr 9, 2012 at 6:43 PM, Margherita Di Leo
> <dileomargher...@gmail.com> wrote:
>>
>>
>>
>> On Mon, Apr 9, 2012 at 5:54 PM, Markus Neteler <nete...@osgeo.org> wrote:
>>>
>>> On Mon, Apr 9, 2012 at 4:25 PM, Margherita Di Leo
>>> <dileomargher...@gmail.com> wrote:
>>> > Ciao Markus,
>>> >
>>> > On Mon, Apr 9, 2012 at 3:47 PM, Markus Neteler <nete...@osgeo.org>
>>> > wrote:
>>> >>
>>> >> Wouldn't it be better to remove them with v.clean and rmarea to avoid
>>> >> holes?
>>> >
>>> >
>>> > just tried with:
>>> >
>>> >
>>> >         grass.run_command('v.clean', input = v_basins,
>>> >                                      output = v_basin,
>>> >                                      type = 'area',
>>> >                                      tool = 'rmarea',
>>> >                                      thresh = 1,     # I also tried 10
>>> >                                      overwrite = True)
>>> >
>>> > Maybe I do something wrong, but this way I can't get rid of small
>>> > polygons,
>>>
>>> what is exactly happening? Nothing or some are removed?
>>
>>
>> In this case, nothing is removed. I'll give it some more try..
>
>
> Looks like small areas are removed, but the table associated to the vector
> map is not updated, hence the records of the small areas are still present
> (cat = 2 and cat = 3). My error? What am I missing?
>
>
> --
> Ing. Margherita Di Leo, Ph.D.
>
>
>
>
> _______________________________________________
> grass-dev mailing list
> grass-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to