I have a bunch of (integer) point data I'm trying
to contour. I've done v.in.ascii, v.surf.idw, and
r.contour. The output vector (the contour shapes)
has a 'level' attribute which is a double.
$ v.info v500contour -c
Displaying column type for database connection of layer 1:
INTEGER|cat
DOUBLE PRECISION|level
When I create labels for those contours (with v.label),
I'm getting six zeroes after the decimal. I really need
to display only integer labels, so how should I go
about that?
I'm running GRASS 6.0.0 on debian sarge.
Many thanks,
- Paul
--
Paul Pick <paul.pick@ec.gc.ca>
Informatics Services Unit Gagetown
Chief Information Officer Branch, Environment Canada
[CSN] 432 2082 [CIV] 506 422 2000 x 2082 [FAX] 506 422 1443
I have not been able to figure out how not to generate a label file with 6 significant figures.
You can however edit the Location/paint/labels/Label_File text file with search and replace all ".000000" to "" which removes the trailing zeros from the 'text: 540.0000000 entires'
dave
On Jun 5, 2006, at 4:13 PM, Paul Pick wrote:
Hi all,
I have a bunch of (integer) point data I'm trying
to contour. I've done v.in.ascii, v.surf.idw, and
r.contour. The output vector (the contour shapes)
has a 'level' attribute which is a double.
$ v.info v500contour -c
Displaying column type for database connection of layer 1:
INTEGER|cat
DOUBLE PRECISION|level
When I create labels for those contours (with v.label),
I'm getting six zeroes after the decimal. I really need
to display only integer labels, so how should I go
about that?
I'm running GRASS 6.0.0 on debian sarge.
Many thanks,
- Paul
--
Paul Pick <paul.pick@ec.gc.ca>
Informatics Services Unit Gagetown
Chief Information Officer Branch, Environment Canada
[CSN] 432 2082 [CIV] 506 422 2000 x 2082 [FAX] 506 422 1443
Paul Pick wrote:
> I have a bunch of (integer) point data I'm trying
> to contour. I've done v.in.ascii, v.surf.idw, and
> r.contour. The output vector (the contour shapes)
> has a 'level' attribute which is a double.
>
> $ v.info v500contour -c
> Displaying column type for database connection of layer 1:
> INTEGER|cat
> DOUBLE PRECISION|level
>
> When I create labels for those contours (with v.label),
[same with "d.vect disp=attr" (try it) or d.what.vect]
> I'm getting six zeroes after the decimal. I really need
> to display only integer labels, so how should I go
> about that?
>
> I'm running GRASS 6.0.0 on debian sarge.
Dave Kent wrote:
I have not been able to figure out how not to generate a label file
with 6 significant figures.
You can however edit the Location/paint/labels/Label_File text file
with search and replace all ".000000" to "" which removes the
trailing zeros from the 'text: 540.0000000 entires'
The labels file is really easy to edit. I think tweaking the offsets by
hand in a parallel editor + d.redraw is probably the best way of getting
things "just right". (my logic is too fuzzy to implement Fuzzy Logic)
Anyway, you won't have to worry about trailing zeros in the future, I've
just updated db_convert_value_to_string() in lib/db/dbmi_base/valuefmt.c
to use G_trim_decimal() if it's a DOUBLE column type. This will affect
d.vect, d.what.vect, v.label, v.db.select, db.select, and probably some
other places in the select & form areas. Hopefully with no ill effects;
it is trimming back from %lf so parts like .000000014 won't be chopped
away in err.
Also, FWIW, GRASS 5's d.site.labels has a precision= option for this.