Subscribe to this thread
Home - General / All posts - Technique for labeling contours
mechalas

839 post(s)
#22-Mar-07 14:03

I've been working on a technique for labeling contour lines in maps that is more readable and clean than auto-labeling, yet nowhere near as manually intensive as having to do everything by hand in an illustration program. I'm still refining this, but I am narrowing in on a pretty good balance, I think, between manual placement and automated labels.

Right now, one of the steps does require surface tools, but there's no reason why this couldn't be done without that extension: it would just take a bit more work.

Here's the process, and note that some of these steps can be automated: Step 1. Create your contours. Step 2. Move your major contour intervals (the ones you will be labeling) into a separate component. This isn't necessary, but it makes life a whole lot easier in step 3. Step 3. Using the "line snap" and "line segment snap" options, create points where you want your labels to appear. The use of the snap will ensure the points lie on the contour lines. This part is critical for step 6. Step 4. Cut the points from the drawing and paste them as a new drawing. Name it "label points" or something obvious. :) Step 5. Create a map with the major contour lines and the points as layers. Step 6. Use "spatial overlay" to transfer lines to contained points. This will transfer the heights from your contour lines to the label points drawing. Note that you could do a spatial overlay with the points and the contours in the same drawing, but you eventually have to separate the points out, anyway. If, for some reason, some points don't transfer, then some of your points didn't "snap" to the line segments. Adjust your drawing precision for your label points and use the "attach to" transform to attach them to the contour lines. Step 7. Add a column to the label points drawing for "Aspect". This should be a floating point number. Step 8. Use this SQL query to transfer the aspect from the source surface to the Aspect column (edited as per Nick Verge's correction). Note that this does require Surface Tools:

    UPDATE [Label points] SET [Aspect]=AspectHeight([Surface],[Geom (I)])+180
We'll use this "Aspect" column to set the label rotation angle. The IIF statements ensure we get (a) positive rotation angles (necessary for thematic formatting) and (b) angles that are oriented for properly for reading on a map. Step 8. Create the labels for the label points drawing. Step 9. Use thematic formatting to set the label rotation. Use the "Aspect" column for the source field, and a method of "Equal Intervals". Select "continuous shading" and 2 breaks. Manually set the range from 0 to 360, with target values of 0 and 360, respectively. This will set the rotation angle to exactly be whatever is in the aspect column. Step 10. Add new points as desired to clarify your drawing.

See the attached .map file which shows a sample map. If you were going to create a printed map, you'd probably want to create buffers around your label points and use those to clip the contour lines around your labels to give a proper, finished look. This would be the very last step once you'd settled on an output size and resolution, since Manifold doesn't change the font size with zoom/scale in a map. Only in a layout component would you be able to correctly gauge the required buffer width.

Attachments:
contour-example.png
contour-labeling.map
theme-settings.png

pcardoso


1,664 post(s)
#22-Mar-07 10:00

That's great! I'm currently working in a few maps where labeling contours turn out to be a very difficult and time consuming task. I have to try this. My results using auto labeling is very disappointing, as you'll see in attached image. =(

Did you noticed that labeling contours will significantly slower refreshing map window?

Attachments:
labeling contours.jpg

mechalas

839 post(s)
#22-Mar-07 13:18

I've long since drawn the conclusion that dynamic contour labeling just isn't a good idea in Manifold. The label renderer works the same for all line styles, and it's just not conducive to the line densities and curves seen in contours. On top of that are the general problems with self-overlapping text on sharp curves, poor control of placement along the lines, etc.

At least with this technique, one can relatively quickly create labels that are still automatically oriented and titled. Once you set up the layers and such, it's as easy as add points, spatial overlay, sql.

Nick's idea, below, suggests possibilities for even automating the placement of the points.

BCowper


1,275 post(s)
#10-Apr-07 09:01

Great work Mechalas, I've been waiting for a real project to try this out.

One step I speeded up was adding the points on the lines - I drew lines, on the same drawing as the contours, crossing the contours where I wanted my labels to appear, selected all contours touching the label lines and the label lines, and used Transform - Intersection Points to generate the points - this also allowed me to align the labels along a straight line.

mechalas

839 post(s)
#10-Apr-07 11:42

Glad to hear you found this useful!

One caution when using slice lines to set your label points is that cartographers generally try not to create noticeable patterns in the contour labels. If you haven't already, you might want to use a curving line to create your intersection points to avoid laddering and stair-stepping in your label points. There's a link earlier in this thread to a thread on CartoTalk that discusses the subject, which I have repeated here for convenience.

Labeling contours is truly an art form. The trick is to make them subtle but easy to locate when reading the map. I think that also translates to time-consuming and tedious!

BCowper


1,275 post(s)
#10-Apr-07 12:22

Thanks for the link to CartoTalk post, I'm a regular reader there, but I hadn't seen this discussion before.

I agree that straight lines are not a good idea - my technique for drawing the crossing lines is the same as if I was drawing a flow direction line for groundwater contours: keeping the lines running perpendicular through each contour. We prefer to have all labels orientated so they can be read left to right (no upside down labels), which seems to be acceptable to the professionals over at CartoTalk.

Redcab4 post(s)
#02-Jun-08 20:41

Mechalas,

Thanks for disseminating the contour labeling technique. I'm an extreme newbie and I've been trying to replicate the methodology but have encountered a problen at Step 9. Steps 1 through 8 worked flawlessly. At the Thematic Formatting step, I follow and even understand your methodology but for some reason my labels are not rotating to the alignment in the Aspect column. I've also reviewed the Rotating Labels section in the User Manual and I can't pinpoint what I'm doing wrong. I've attached a screenshot of my thematic formatting FYI. Any suggestions?

Thanks for the help.

Jim

Attachments:
ThematicLabels.jpg

Graeme

990 post(s)
#02-Jun-08 22:45

Hi, did you press the "Tally" button after making your changes? That might fix it..

James

326 post(s)
#03-Jun-08 07:40

This solution couldn't have come at a better time for me as I needed to produce some contours. It worked first time and is very simple. Here's my labelling (not too fussed about cartographic excellence!!)

Cheers

Attachments:
Contours.png

Redcab4 post(s)
#03-Jun-08 07:55

I tried tallying and it didn't help. I'm obviously not doing something right but I'm at a loss. James, your labels look great and that's what I'm shooting for.

James

326 post(s)
#03-Jun-08 08:30

but for some reason my labels are not rotating to the alignment in the Aspect column.

You've got 2 values of 30 and 30 in your rotation theme dialogue. Try manually setting these to 0 and 360.

Redcab4 post(s)
#03-Jun-08 09:37

James,

Me thinks I'm an idiot! Thanks for your help. Sometimes the simplest things get missed.

Jim

stephenbc29 post(s)
#29-Jul-14 07:33
stephenbc29 post(s)
#29-Jul-14 21:15

Can your method be applied to a drawing component that has lines (contours) as opposed to a surface? I suspect Step 8 would require modification...if so, how?

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.