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

GRASS GIS trac at osgeo.org
Mon Jul 9 15:59:09 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
 Keywords:               |        CPU:  Unspecified
 Platform:  Unspecified  |
-------------------------+-------------------------
 Previously discussed at https://pvanb.wordpress.com/2015/10/31/grass-gis-
 categorical-raster-layers-in-qgis/comment-page-1/#comment-12254

 It works e.g. with the landuse layer from the North Carolina dataset.

 But when I use my own rasters I’m getting errors like the one below:

 {{{
 r.category.trim input=test at Tata qgis=C:\Processing\test cat.txt
  Traceback (most recent call last):
  File “C:\Users\alistair\AppData\Roaming\GRASS7\addons/scri
  pts/r.category.trim.py”, line 197, in
  sys.exit(main(*gs.parser()))
  File “C:\Users\alistair\AppData\Roaming\GRASS7\addons/scri
  pts/r.category.trim.py”, line 123, in main
  CCAT = map(int, CCAT)
  ValueError: invalid literal for int() with base 10:
 ‘24.0862’
 }}}

 I'm pretty sure that it is an integer raster.
 It was made with v.to.rast using an attr column that db.describe confirms
 contains integers.

 These are the categories:
 {{{
 r.category map=test at Tata
  24 cat2
  46 cat1
 }}}

 And if I load the raster into QGIS it describes it the same as the NC
 landuse i.e. "Thirty two bit signed integer", and "No data value" =
 -2147483648

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



More information about the grass-dev mailing list