Here's an example, using the North Carolina basic mapset. First I extract a subset from the builtin geology
polygon vector. This way, I have some small and some large areas, that are not contiguous. So the smoothing will be obvious. Then I add and populate (as you did) an area attribute.
Now, I can do v.generalize with the where=
condition.
But note: you must specify the layer for this to work. The default is to use all layers, and in that case, where=
is ignored. This was pointed out 1n the grass-users maillist message.
micha@TP480:~$ v.extract geology output=my_geology --o where="GEO_NAME='Qp'"
Extracting features...
100%
Building topology for vector map <my_geology@user1>...
Registering primitives...
Building areas...
100%
Attaching islands...
100%
Attaching centroids...
100%
Writing attributes...
micha@TP480:~$
micha@TP480:~$ v.db.addcolumn my_geology column="area_sqkm DOUBLE"
micha@TP480:~$ v.to.db my_geology option=area unit=kilometer column=area_sqkm
WARNING: Values in column <area_sqkm> will be overwritten
Reading areas...
100%
Updating database...
100%
326 categories read from vector map (layer 1)
326 records selected from table (layer 1)
326 categories read from vector map exist in selection from table
326 records updated/inserted (layer 1)
# Only a few polygons have area > 20 sq.km.:
micha@TP480:~$ v.db.select my_geology column=area_sqkm where="area_sqkm>20"
area_sqkm
141.526059
45.783948
27.856732
2688.963279
5030.98666
47.616086
93.061948
942.740866
25.049455
1027.366856
25.867045
33.64133
23.780279
29.099771
56.994219
22.329903
# Now run v.generalize, with a where clause. And be sure to specify the layer
micha@TP480:~$ v.generalize my_geology output=my_geology_smooth layer=1 type=area method=douglas thresh=100 where="area_sqkm>10" --o
Copying features...
100%
Building topology for vector map <my_geology_smooth@user1>...
Registering primitives...
Building areas...
100%
Attaching islands...
100%
Attaching centroids...
100%
-----------------------------------------------------
Generalization (douglas)...
Using threshold: 100 meters
100%
-----------------------------------------------------
Building topology for vector map <my_geology_smooth@user1>...
Registering primitives...
Building areas...
100%
Attaching islands...
100%
Attaching centroids...
100%
-----------------------------------------------------
v.generalize complete. Number of vertices for selected features reduced
from 31709 to 5125 (16% remaining)
Here's a zoom in view of the results. The red lines are the generalized boundaries. The blue areas are the original. You can see that the large area has been generalized, but the small "islands" have not.

where="<sql>"
works only on area vectors. – Micha Apr 19 at 11:36v.db.addcolumn
, thenv.to.db option=perimeter columns=wayperimeter
to add a column with e.g. perimeter data. I wonder if I then can usev.generalize where='wayperimeter > 100'
or similar to achieve what I want. – Grigory Rechistov Apr 19 at 11:57