#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 mmetz):
Replying to [comment:6 cmbarton]:
> There is no reason why only a map with integer values should have labels
and a map with float values should not. Sometimes discrete data are coded
with real numbers for a variety of reasons. Having labels for these values
should not be arbitrarily prohibited.
According to the manual of r.category, floating point values are fine. The
problem is a bug in v.to.rast which writes out ranges for labels instead
of unique labels. The cats file contains something like
{{{
1.5:2:first line
2:2.5:second line
2.5:3:third line
}}}
that is, 3 ranges for 4 values, and the last label got lost. v.to.rast
should instead write out unique labels as
{{{
1.5:first line
2:second line
2.5:third line
3:fourth line
}}}
Further on, v.to.rast should remove duplicate values before creating
raster categories, otherwise the result could be something like
{{{
1.5:first line
1.5:first line
2:second line
1.5:first line
2.5:third line
1.5:first line
3:fourth line
1.5:first line
}}}
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1124#comment:7>
GRASS GIS <https://grass.osgeo.org>