v.to.rast inconsistency in importing label
|Reported by:||cmbarton||Owned by:|
We just ran into a strange inconsistency in the behavior of v.to.rast. This happens if you are trying to use vector attributes to populate the cat and label fields of a new raster.
If you have a float (double precision) attribute to use for the raster cat and string attribute to use for the raster label, the float is imported into the raster cat fine. But the string is imported from the vector attribute to the raster label ONLY if the value in the corresponding attribute to use for the cat has no decimals. For example:
here is a vector attribute table with 2 attributes and 4 records:
float_attr str_attr ========= ======= 1.5 "first line" 2 "second line" 2.5 "third line" 3 "fourth line"
v.to.rast is run as follows:
v.to.rast input=vectorfile output=newraster use=attr type=point column=floatattr labelcolumn=strattr
The result is that raster cells with values 2 and 3 have labels, but the cells with values 1.5 and 2.5 do not have labels.