[GRASS-dev] [GRASS GIS] #1124: v.to.rast inconsistency in importing label

GRASS GIS trac at osgeo.org
Tue Aug 16 09:48:30 PDT 2016


#1124: v.to.rast inconsistency in importing label
-----------------------+------------------------------
  Reporter:  cmbarton  |      Owner:  grass-dev@…
      Type:  defect    |     Status:  new
  Priority:  major     |  Milestone:  6.4.6
 Component:  Raster    |    Version:  svn-develbranch6
Resolution:            |   Keywords:  v.to.rast
       CPU:  All       |   Platform:  All
-----------------------+------------------------------

Comment (by mlennert):

 Replying to [ticket:1124 cmbarton]:
 > We just ran into a strange inconsistency in the behavior of v.to.rast.
 This happens if you are trying to use vector attributes to populate the
 cat and label fields of a new raster.
 >
 > If you have a float (double precision) attribute to use for the raster
 cat and string attribute to use for the raster label, the float is
 imported into the raster cat fine. But the string is imported from the
 vector attribute to the raster label ONLY if the value in the
 corresponding attribute to use for the cat has no decimals. For example:
 >
 > here is a vector attribute table with 2 attributes and 4 records:
 >
 >
 > {{{
 > float_attr     str_attr
 > =========     =======
 > 1.5           "first line"
 > 2             "second line"
 > 2.5           "third line"
 > 3             "fourth line"
 > }}}
 >
 >
 > v.to.rast is run as follows:
 >
 > v.to.rast input=vectorfile output=newraster use=attr type=point
 column=floatattr labelcolumn=strattr
 >
 > The result is that raster cells with values 2 and 3 have labels, but the
 cells with values 1.5 and 2.5 do not have labels.

 I would actually consider this logical: what does a label for an arbitrary
 precision number mean ? In my eyes, labels only make sense for CELL maps,
 not really for DCELL or FCELL, or it should be range labels, not exact
 value label.

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



More information about the grass-dev mailing list