[GRASSLIST:6578] Who wants contour lines labeled "300.000000"?
jidanni at jidanni.org
Wed Apr 20 17:05:27 EDT 2005
Who wants contour lines marked "300.000000"?
But that's what we're stuck with
r.contour input=c4 output=c5 step=5
d.vect display=attr attrcol=level map=c5
Let's see what else we might try in GRASS 6.0.0beta2 (2005).
v.label map=c5 column=level labels=c8
d.paint.labels labels=c8 #BROKEN, so forget it.
v.out.ascii also broken, so forget examining anything. "It just
doesn't write any files anymore."
echo ALTER TABLE c5 ADD COLUMN contour integer|db.execute
echo UPDATE c5 SET contour = level|db.execute #FAILS,
who knows how to write this, not me. Docs of course not forthcoming.
I can't even do "SET contour = 2 + 2", "SET contour = 2" works however.
And who knows how to remove that column I just added now that I won't
be using it. Not me. Maybe how to do it is in
/usr/lib/grass/docs/html/sql.html but I can't tell. Wait:
echo SELECT cat,level FROM c5|db.select -c|
perl -pwe 's/(.*)\|(.*)\..*/UPDATE c5 SET contour = $2 \
WHERE cat = $1;/'|db.execute #WORKS! (Unless you forget the ';': segfault)
OK, we can finally do
d.vect c5; d.vect display=attr attrcol=contour map=c5 xref=center \
bgcolor=white lcolor=black lsize=7
Quit while I'm ahead? Well can't I have more than one label along a
contour line, like those maps that Mom used to make?
Maybe that's what d.paint.labels was for, before it got injured or
I know, I'll make a skinny region, the labels are sure to go there.
g.region w=228000 e=228100
d.vect c5 #testing: yes, contours appear only in region. Good.
d.vect display=attr attrcol=contour map=c5 #No, labels still written
all over the place. BUG.
I know. I will sit back and let the pros tell me the pro way to put
more than one contour label on a contour line. Or maybe it's like
Perl: there's more than one way to do it.
GRASS: there's less than one way to do it.
In the article above, Dan Jacobson reflected the frustration he was
having with GRASS.
More information about the grass-user