[GRASSLIST:6707] Re: Who wants contour lines labeled "300.000000"?

Hamish hamish_nospam at yahoo.com
Wed May 4 03:18:12 EDT 2005


> > Dan Jacobson wrote:
> > Who wants contour lines marked "300.000000"?
..
> > d.vect display=attr attrcol=level map=c5

In GRASS 5.4 this is controled by the precision= option in
d.site.labels.

In GRASS 6.0 it is a bit more complicated, patch attached to fix it.

I've been using it for a while but haven't put it in CVS as it has some
unwelcome side effects:

- projected easting and northing values which should be reported as 
xxxxxxxx.yyy get converted to 1.23456+e06 and lat/lon values which
should show at least ddd.dddddd can round off the last digit, leading to
an unwanted reduction of data quality. (maybe %.15 fixes that second
case?)

As the library function that generates the string is not just limited
to d.vect, I am a bit loath to change it as it might adversely affect
v.out.* (e.g.) modules as well.

And so it sits as is until someone can come up with a better idea.

perhaps test for range and then output depending on %f rules.



> Dylan Beaudette wrote:
> I think  that part of the reason there aren't yet any robust feature
> labeling routines is that GRASS is not (currently) aimed at
> cartographic output

Well not primarily aimed there. I see no reason it shouldn't be
improved, it just needs someone to work on it. When GMT et al. are
already there and do the job well this becomes a less urgent priority.

Personally I think ps.map can make really nice hardcopy maps and the
d.* modules are flexible enough to make nice presentation and web
graphics in most cases. Again, speaking for myself, I think it is nice
if GRASS can do a halfway decent job at GUI, graphics output, etc. with
no additional software for the user to install. If someone wants a fancy
GUI or fancy graphics then by all means make it easy for them to use
QGIS, GMT, POVray, etc. as well. Interoperability can only help us.


> I have found GMT to be an excellent solution for creating cartographic
> products directly based on GRASS rasters.

sure. In the Free software world the best solution is to let the user
use what ever software works best for them; no single vendor
"do-everything" boondoggles to promote lock-in.



regards,
Hamish



Index: valuefmt.c
===================================================================
RCS file: /home/grass/grassrepository/grass51/lib/db/dbmi_base/valuefmt.c,v
retrieving revision 1.2
diff -u -r1.2 valuefmt.c
--- valuefmt.c  20 Mar 2005 06:23:16 -0000      1.2
+++ valuefmt.c  4 May 2005 06:43:21 -0000
@@ -68,7 +68,7 @@
            sprintf (buf, "%d",db_get_value_int(value));
            break;
        case DB_C_TYPE_DOUBLE:
-           sprintf (buf, "%lf",db_get_value_double(value));
+           sprintf (buf, "%.15g",db_get_value_double(value));
            break;
        case DB_C_TYPE_STRING:
            bp = db_get_value_string(value);




More information about the grass-user mailing list