[GRASS-dev] [GRASS GIS] #3005: v.to.rast allow to use label_column alone

GRASS GIS trac at osgeo.org
Mon May 9 14:18:04 PDT 2016


#3005: v.to.rast allow to use label_column alone
--------------------------+-------------------------
  Reporter:  marisn       |      Owner:  grass-dev@…
      Type:  enhancement  |     Status:  new
  Priority:  minor        |  Milestone:  7.2.0
 Component:  Vector       |    Version:  svn-trunk
Resolution:               |   Keywords:  v.to.rast
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+-------------------------

Comment (by mmetz):

 Replying to [ticket:3005 marisn]:
 > At the moment v.to.rast only supports label_column together with
 attr_column. It makes perfect sense, still misses one use case - when
 attr_column is absent and only labels are present. I.e. when attribute
 table contains land use labels but not class codes.
 >
 > Proposal is to generate codes on the fly if only label column is
 provided.
 >
 > How it could work: select labelcolumn from db distinct; Enumerate output
 rows; Use row number as a raster category.

 You can use v.reclass + v.to.rast, e.g. with the NC dataset

 {{{
 v.reclass in=soils_general at PERMANENT out=soils_reclass layer=1
 column=GSL_NAME
 g.region -pa vect=soils_reclass res=100
 v.to.rast in=soils_reclass layer=1 use=cat label_column=GSL_NAME
 }}}

 or write a script that does the above for any given vector and label
 column for general use.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3005#comment:2>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list