[GRASS-dev] [GRASS GIS] #3604: errors running r.category.trim

GRASS GIS trac at osgeo.org
Wed Jul 18 03:18:04 PDT 2018


#3604: errors running r.category.trim
--------------------------+-------------------------
  Reporter:  Alister      |      Owner:  pvanbosgeo
      Type:  defect       |     Status:  assigned
  Priority:  normal       |  Milestone:
 Component:  Addons       |    Version:  7.4.0
Resolution:               |   Keywords:
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+-------------------------

Comment (by pvanbosgeo):

 I see where the problem lies. When converting a vector layer to raster, it
 gets assigned a gradient color table. With your example file, run
 r.colors.out.

 {{{
 r.colors.out map=example_vtorast at PERMANENT
 }}}

 This gives (I omitting the middle part)

 {{{
 24 68:1:84
 24.0862 68:2:86
 ...
 ...
 45.9138 251:231:35
 46 253:231:37
 nv 255:255:255
 default 255:255:255
 }}}

 I.a.w., the categories in the color table are continuous. I would expect
 that in case the values in the column used as categories in v.to.rast are
 integer, the color table should be set accordingly. But as that is
 evidently not the case now, I can try to find a workaround.

 For now, you can either create a RGB column in the vector layer and use
 that to assign colors (see v.to.rast) or set the colors using r.colors
 using color rules or the interactive tool to set colors.

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



More information about the grass-dev mailing list