Opened 8 years ago
Last modified 7 years ago
#3335 new defect
v.to.rast with label_column set results in raster with part of raster cells without label
Reported by: | pvanbosgeo | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.2.4 |
Component: | Default | Version: | unspecified |
Keywords: | Cc: | ||
CPU: | Unspecified | Platform: | Unspecified |
Description
Converting a vector to raster does in some specific cases yields yields issues with the labeling. E.g., the following (using the NC dataset) results in a layer with each raster cells assigned a category label (the name of the municipality):
v.to.rast input=boundary_municp output=A01 use=attr attribute_column=OBJECTID label_column=MB_NAME type=area
Running the following will give a raster in which a portion of the cells do not have a label.
v.extract input=boundary_county where="NAME='WAKE'" output=WakeCounty v.overlay ainput=boundary_municp binput=WakeCounty operator=and output=WakeMunicp olayer=0,1,0 g.region vector=WakeMunicp res=100 -a v.to.rast input=WakeMunicp output=A02 use=attr attribute_column=OBJECTID label_column=MB_NAME type=area
or:
v.extract input=boundary_municp where="COUNTY='WAKE'" output=WakeMunicp2 g.region vector=WakeMunicp2 res=100 -a v.to.rast input=WakeMunicp2 output=A03 use=attr attribute_column=OBJECTID label_column=MB_NAME type=area
Same results, some of the raster cells do not get a label.
Change History (7)
follow-up: 2 comment:1 by , 8 years ago
follow-up: 3 comment:2 by , 8 years ago
Replying to mmetz:
Replying to pvanbosgeo:
The problem appears when a label is assigned to a range of values, e.g.
992:996:Morrisvillethis means that all raster values from 992 to 996 should get the same label "Morrisville". The raster library supports writing such a range of values for all map types with Rast_set_cat(), but reading such a range of values is supported only for fp maps (FCELL, DCELL).
Please try trunk r70900.
Quick try, seems to work now, thanks. So this means it now works for integer maps as well?
comment:3 by , 8 years ago
Replying to pvanbosgeo:
Replying to mmetz:
Replying to pvanbosgeo:
The problem appears when a label is assigned to a range of values, e.g.
992:996:Morrisvillethis means that all raster values from 992 to 996 should get the same label "Morrisville". The raster library supports writing such a range of values for all map types with Rast_set_cat(), but reading such a range of values is supported only for fp maps (FCELL, DCELL).
Please try trunk r70900.
Quick try, seems to work now, thanks. So this means it now works for integer maps as well?
Yes, getting a label for a range of values now works for CELL maps as well (setting a label for a range of values was already possible).
comment:4 by , 8 years ago
Milestone: | 7.2.1 → 7.2.2 |
---|
comment:7 by , 7 years ago
Milestone: | → 7.2.4 |
---|
Replying to pvanbosgeo:
The problem appears when a label is assigned to a range of values, e.g.
this means that all raster values from 992 to 996 should get the same label "Morrisville". The raster library supports writing such a range of values for all map types with Rast_set_cat(), but reading such a range of values is supported only for fp maps (FCELL, DCELL).
Please try trunk r70900.