Opened 8 years ago

Last modified 5 years ago

#3005 new enhancement

v.to.rast allow to use label_column alone

Reported by: marisn Owned by: grass-dev@…
Priority: minor Milestone: 7.6.2
Component: Vector Version: svn-trunk
Keywords: v.to.rast Cc:
CPU: Unspecified Platform: Unspecified

Description

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.

Change History (10)

comment:1 by neteler, 8 years ago

Milestone: 7.1.07.2.0

Milestone renamed

in reply to:  description comment:2 by mmetz, 8 years ago

Replying to 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@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.

comment:3 by neteler, 7 years ago

Milestone: 7.2.07.2.1

Ticket retargeted after milestone closed

comment:4 by martinl, 7 years ago

Milestone: 7.2.17.2.2

comment:5 by martinl, 7 years ago

Milestone: 7.2.27.4.0

All enhancement tickets should be assigned to 7.4 milestone.

comment:6 by neteler, 6 years ago

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:7 by neteler, 6 years ago

Milestone: 7.4.17.4.2

comment:8 by martinl, 6 years ago

Milestone: 7.4.27.6.0

All enhancement tickets should be assigned to 7.6 milestone.

comment:9 by martinl, 5 years ago

Milestone: 7.6.07.6.1

Ticket retargeted after milestone closed

comment:10 by martinl, 5 years ago

Milestone: 7.6.17.6.2

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.