[GRASS-user] Generating categorical int values from a string attribute for use with v.to.rast

Markus Metz markus.metz.giswork at gmail.com
Thu Nov 15 23:44:41 PST 2018


On Fri, Nov 16, 2018 at 7:30 AM Helmut Kudrnovsky <hellik at web.de> wrote:
>
> >Thank you for your reply. There are many potential categories and
> >thousands of polygons, do you have insight on how to assign int values
> >on-the-fly using v.db.update? Hard coding all potential values would be
> >cumbersome in this application. :)
>
> have you read the manual?:
>
> https://grass.osgeo.org/grass76/manuals/v.db.update.html
>
> where=sql_query
>     WHERE conditions of SQL statement without
>
> looping through your categories in sm_soil_se by a where clause and
> v.db.update the sm_soil_se_int column accordingly?

You could also use v.reclass, e.g.

v.reclass input=soils column=sm_soil_se output=soils_reclass

all areas with the same string value in "sm_soil_se" will get the same
category value.

Markus M
>
>
>
> -----
> best regards
> Helmut
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20181116/a4ae0cba/attachment.html>


More information about the grass-user mailing list