[GRASS-user] v.rast.stats skipping polygons. Why?

Veronica Andreo veroandreo at gmail.com
Tue Oct 31 15:47:32 PDT 2023


Hola Hernán,

Do your polygons have repeated/shared cat values? That might be one
potential cause according to the Notes in the manual:
https://grass.osgeo.org/grass83/manuals/v.rast.stats.html

just my 2 cents
Vero

El mar, 31 oct 2023 a las 6:35, Hernán De Angelis via grass-user (<
grass-user at lists.osgeo.org>) escribió:

> Hi all,
>
> I have a vector layer with 97015 polygons (lakes in real life) many of
> which are complicated, with islands. The layer has been cleaned using
> v.clean (during import, and after as well). I then run v.stats.rast to
> pick statistics from a raster. This works well for about 3/4 of the
> categories while about 1/4 are skipped. Why?
>
>  From v.stats.rast:
> WARNING: Not all vector categories converted to raster. Converted 73078 of
>           97837.
> Processing input data (73078 categories)...
>
> I see that v.to.rast has no problems converting polygons to raster (only
> visually checked). A test running v.rast.stats using the rasterized
> vector reports:
> WARNING: Not all vector categories converted to raster. Converted 97015 of
>           97837.
> Processing input data (97015 categories)...
> That is, it converts all polygons.
>
> I have cleaned, and rebuilt topology to no avail. Also calling
> v.rast.stats using layer (1) and type (centroid) did not change the
> results.
>
> Am I missing something here? Why is this happening and what can be done
> to calculate raster statistics for all polygons?
>
> Thanks in advance!
>
> Hernán
>
>
> v.category report is:
>  > v.category input=lakes option=report
> Layer/table: 1/lakes
> type       count        min        max
> point          0          0          0
> line           0          0          0
> boundary       0          0          0
> centroid   97837          1      97015
> area           0          0          0
> face           0          0          0
> kernel         0          0          0
> all        97837          1      97015
> Layer: 2
> type       count        min        max
> point          0          0          0
> line           0          0          0
> boundary       0          0          0
> centroid      21          2          2
> area           0          0          0
> face           0          0          0
> kernel         0          0          0
> all           21          2          2
>
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20231031/48c5be0e/attachment.htm>


More information about the grass-user mailing list