[GRASS-user] v.to.rast with text column

Markus Neteler neteler at osgeo.org
Wed Oct 14 13:19:19 EDT 2009


IMHO ticket 175 has been fixed. I can now run (thanks to Martin):

v.db.select lsat7_training
cat|name|id
1|water|1
3|forest|2
4|forest|2
5|asphalt|3
6|asphalt|3
7|water|1
...
v.to.rast in=lsat7_training out=lsat7_training use=attr col=id labelcol=name

As Achim says: col must be numerical and should be the numerical
representation of the text attributes (see example above).

Markus

On Wed, Oct 14, 2009 at 1:39 PM, Hamish <hamish_b at yahoo.com> wrote:
> see also  https://trac.osgeo.org/grass/ticket/175
>
>
> Achim wrote:
>> v.to.rast has the option:
>>
>> --%<--
>> labelcolumn=name
>>     Name of column used as raster category
>> labels
>> --%<--
>>
>> And the raster values have to be numeric:
>>
>> --%<--
>> column=name
>>     Name of column for attr parameter (data type
>> must be numeric)
>> --%<--
>>
>> (http://grass.itc.it/grass64/manuals/html64_user/v.to.rast.html)
>>
>> Try to make unique numbers from your string-column and
>> convert them with
>> column=... and labelcolumn...
>>
>> Achim
>>
>>
>> Dylan Beaudette schrieb:
>> > Hi,
>> >
>> > v.to.rast is letting me know that it does not accept
>> text columns in an
>> > attribute table. Has anyone figured out a simple
>> approach to making this
>> > work? I suppose that I could import the data into R,
>> convert to factors, save
>> > the levels back to the table and use those... but
>> there may be something out
>> > there that is simpler and can be done within GRASS.
>> Also, would this be
>> > something worth adding to the v.to.rast code?
>> >
>> > Cheers,
>> > Dylan
>
>
>
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>


More information about the grass-user mailing list