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
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@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@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
Hola Vero,
Thank you. There were a few repeated or shared categories but not as many as skipped polygons. The problem was with the data like many extremely small lakes and a too coarse raster resolution to capture all of them them. This is solved now.
All well, thanks again
/Hernán
···
Den 2023-10-31 kl. 23:47, skrev Veronica Andreo:
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@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@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user