[GRASS-dev] r.to.vect and length of `label` column

Nikos Alexandris nik at nikosalexandris.net
Sun Oct 7 07:40:44 PDT 2018


Converting a series of raster maps to vector maps via `r.to.vect`,
a successive attempt to patch the latter fails due to unequal length of string
columns.

Looking closer,

for MAP in $(g.list vector pattern=maes_ecosystem_types_flow_?) ;do r.category $MAP && db.select -d table=$MAP |grep len |tail +4 && echo ;done
1       819.993915
2       64756.579317
3       13466.606949
4       658.046060
7       42.997866
len:22

1       622.614171
2       4991.401845
3       153687.376784
4       2170.723642
len:23

1       198.957465
2       13895.863646
3       210499.960375
len:23

1       15083.810110
2       24698.461515
3       284037.810349
4       326.609984
len:23

1       15518.904368
2       1862.716795
3       129687.941074
4       463.872985
len:23

1       8767.694074
2       2855.013908
3       55224.852660
len:22


shows that, indeed, of length 22 are the output vector attribute table columns
for raster category labels of length 12  and  of length 23 labels that
derive from raster category labels of length 13.

Out of curiosity, why is this so?  Why isn't the output's length identical
to the (maximum) input's length?

Nikos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20181007/a084a9ae/attachment.sig>


More information about the grass-dev mailing list