On closer inspection it appears that the labels layer created with v.label
will not display in the Map Display.
However, I'm able to display labels from the vector layer by ticking the
'attrcol' option.
Maybe there is an option I need to tick or modify in v.label, but I'd be
grateful for any suggestions.
To create the label layer:
v.label map=hydrobasins_africa@hydrolayers column=MAJ_NAME color=red
Labeled 2355 lines.
NOTE: okay there are too many labels to display and v.label.sa might be more
appropriate, but even with the latter I get an empty label layer created (a
different issue I don't know, but I'm just trying to get v.label to work
first)
To display labels in Map Display:
1. Add vector layer and zoom to selected display
2. Add above labels layer into Layer Manager
(the default) is measured in map units. So in your case it would make the
labels sized as 100 meters on the map. If you zoom way out that becomes
very tiny and the label disappears. (see also the d.labels min and max
options)
If I set a label size in v.label (pts), then this appears to take precedence
over the label size setting (in map units). However, if I don't set a label
size (in pts), no matter the label size setting (ie., map units), the labels
are not displayed. Or is this because my layer is in lat long degrees?
It appears I can set the label size (map units) from the command line and the
label re-sizing works as expected (provided I omit the fontsize option).
However, I can't seem to omit the fontsize option if running from the module
window.
E.g. this works for a lat long layer, input in the command console, where
the labels change in size on zooming.
v.label labels=hydro_africa_lables.lbl map=hydrobasins_africa@hydrolayers
column=MAJ_NAME size=0.25 color=red
On Sun, Apr 21, 2013 at 8:27 AM, RichardC <richtcooper@hotmail.com> wrote:
It appears I can set the label size (map units) from the command line and the
label re-sizing works as expected (provided I omit the fontsize option).
However, I can't seem to omit the fontsize option if running from the module
window.
yes, the problem is that after you change the fontsize option in the
dialog, now there is no way to disable it, you have to close it and
open it again. Related ticket 1048 [1].
As for the cartographic composer, labels are not yet supported. I will
try to add it soon. Meanwhile, you can export the instructions file,
add labels instruction there and run ps.map with this file. Do not
forget to change region appropriately (region settings from the
instruction file header).
E.g. this works for a lat long layer, input in the command console, where
the labels change in size on zooming.
v.label labels=hydro_africa_lables.lbl map=hydrobasins_africa@hydrolayers
column=MAJ_NAME size=0.25 color=red
yes, the problem is that after you change the fontsize option in the
dialog, now there is no way to disable it, you have to close it and
open it again. Related ticket 1048 [1].
Thanks.
As for the cartographic composer, labels are not yet supported. I will
try to add it soon. Meanwhile, you can export the instructions file,
add labels instruction there and run ps.map with this file. Do not
forget to change region appropriately (region settings from the
instruction file header).
I've tried adding all the contents of the label file directly in to the
instruction (.psmap) file and also formatting the latter (as per the ps.map
manual) with
labels hydrobasins_5May2013@hydrolayers
font standard
end
However, I still can't display the labels in the map composer?
I'd be grateful for any suggestions. Thanks,
Richard
I've tried adding all the contents of the label file directly
in to the instruction (.psmap) file and also formatting the
latter (as per the ps.map manual) with
labels hydrobasins_5May2013@hydrolayers
font standard
end
However, I still can't display the labels in the map
composer?
try getting rid of the 'font standard'.
from the ps.map man page:
"""
font font name
The name of the PostScript font. Fonts
present in all PostScript implementations
are: Times-Roman, Times-Italic, Times-
Bold, Times-BoldItalic, Helvetica, Hel-
vetica-Oblique, Helvetica-Bold, Hel-
vetica-BoldOblique, Courier, Courier-
Oblique, Courier-Bold, and Courier-
BoldOblique.
The default is Helvetica.
"""
also try using "fontsize 12" or so, the default with v.labels
is to size the font by map units (to allow e.g. small towns to
dissapear as you zoom out), but if you mistake the size setting
for fontsize, you letters are e.g. 12m tall on a grid of many
kilometers..
does the same labels file work ok in an Xmon with 'd.labels'?
does the same labels file work ok in an Xmon with 'd.labels'?
Yes, I can see the labels in the Map Display.
I've run v.labels with font Helvetica and inserted Helvetica in psmap file,
and also tried changing fontsize in psmap file. I also tried with a
projected map layer, but still cannot see the labels in the Map Composer...
I've run v.labels with font Helvetica and inserted Helvetica
in psmap file, and also tried changing fontsize in psmap file.
I also tried with a projected map layer, but still cannot see
the labels in the Map Composer...
I think it's simply a matter of the composer not knowing anything
about labels (yet). It still doesn't know about all the things
that the ps.map back-end can do. But you don't need the composer
to render, just run ps.map manually with your .psmap input rules
file.
On Sun, May 5, 2013 at 1:01 PM, Hamish <hamish_b@yahoo.com> wrote:
Richard wrote:
> I've run v.labels with font Helvetica and inserted Helvetica
> in psmap file, and also tried changing fontsize in psmap file.
> I also tried with a projected map layer, but still cannot see
> the labels in the Map Composer...
I think it's simply a matter of the composer not knowing anything
about labels (yet). It still doesn't know about all the things
that the ps.map back-end can do. But you don't need the composer
to render, just run ps.map manually with your .psmap input rules
file.
I recently added support for labels in composer in grass 7 (Add
overlays -> Add labels). However I somehow overlooked the font option, so
it's not yet supported.