[GRASSLIST:710] Re: Contours' labels

Paul Kelly paul-grass at stjohnspoint.co.uk
Sat Jul 12 20:16:07 EDT 2003


Hello
A few ideas below; you don't describe the file format in enough detail for
me to totally understand so I am basing this on my experience with the
Northern Ireland Ordnance Survey DXF files....

On Sat, 12 Jul 2003, Kurt Springs wrote:

> Hi again folks,
>
> New question.  I have these contour lines that I am not sure are labelled.
> These were transferred over from a .dxf file.  I used v.in.dxf to extract
> the layers.  There were the tree contour layers and a label layer.  Used
> v.patch to couple combine the three layers and the label layer.  Then I ran
> v.support on the resultant map.  I ran v.llabel on the file, thinking it
> would take the label layer and attach the labels to the contours.

No it wouldn't do that; it either labels all the lines with the same
attribute number or increments it by 1 for each line so they are all
different. So the numbers wouldn't make any sense at all. Probably if you
ran v.in.dxf3d it might label the lines (based on z-co-ordinates in the
DXF file; v.in.dxf doesn't import these). I couldn't imagine the dxf file
would be so poorly formed that the contour lines wouldn't have labels
attached to them as z co-ordinates already.

At a rough guess I would say your 'label layer' consists only of text labels
designed to make the map look nice if you view it or print it in AutoCAD or
some other dxf viewing software. Probably you don't actually need it for your
work. Have you tried looking at the file in AutoCAD?

But in the unlikely event that there are no labels directly attached the
contour lines in the dxf files, probably your only solution would be to
use the manual contour labelling feature in v.digit.

Try v.in.dxf followed by v.in.dxf3d, v.patch, v.support and v.surf.rst.
Note that if there are any zero elevations in you file, v.support will
delete them. You would need to go into a much more complicated procedure
of attaching the elevations as category labels instead of attribute numbers
in that case.

> I made a
> raster file out of this vector map using v.surf.rst.  When I ran r.color to
> set the colours for the elevations, then displayed the map, the colours
> didn't come out as they should have.

v.surf.rst sets a very nice colour table appropriate for elevation data by
default, so you should check what the raster looks like first before
trying changing it.

> I am concluding that v.llabel does not
> work as I though it did.  If one extracts contours and their labels from a
> dxf file, how does one ensure that the labels (i.e. 100 200 300 ... Metres)
> will attach to their respective contours.

As far as I am aware you can only do this tediously and manually. But I
don't think you need to if you use v.in.dxf3d as described above. BTW I am
not sure if v.in.dxf3d.sh works properly; certainly it is more transparent
what is going on if you run v.in.dxf3d separately.

Paul




More information about the grass-user mailing list