Subscribe to this thread
Home - General / All posts - Convert labels to points for exact label location
firsttube


1,439 post(s)
#10-Dec-12 17:45

I'm working on a hard copy map book product that contains lots of map features close together. All labels must be visible and not overlapping any other label. Manifold's labeling engine is not allowing this to happen. So I need to focus on work-around methods to do this.

What I am planning to do is have a separate drawing that contains the points where the label should appear. I'd like to use Manifold's overlap resolution placement first, unlink the labels component, then extract the longitude/latitude of each of these label points into a table. This table will contain the feature ID, the X and Y, and the label text. It would be used to create a linked drawing from which the labels would be created (after being moved manually to avoid collisions). These points would be the permanent label of each feature.

I tried copying the labels component and "paste as" drawing. The points that were created were the original label tie point, not the "shifted" placement done by Manifold's overlap-resolution. Is there any way to extract the "shifted" label location at a particular scale (not the location of the tie point)? i.e. the actual location of the centroid of the label text object.

The other way to think of it is I need to know how far a label has been moved (in map units) and in what direction.


"The blessing in life is finding the torture you are comfortable with." - Jerry Seinfeld, 6/26/2013

Mike Pelletier

2,122 post(s)
#10-Dec-12 19:35

Always great to see ideas on how to label in Manifold. You might give this a try but it might have the same problem. Create your labels and then export them from a map to DXF and then import them back in.

Labeling is often a big issue. Line labels that follow lines too closely and become unreadable has been a huge frustration for me along with Manifold's apparent attitude to the problem (really it's a bug). I'm just getting started with Tilemill which has some very impressive cartography and labeling capabilities. It's not ultra user friendly but it's capabilities over much promise. Perhaps you could generate labels in Tilemill and move them over to Manifold via PDF or SVG and another software as a go between.

tjhb
10,094 post(s)
#11-Dec-12 00:06

You can get the current (adjusted) position of each label via the object model.

E.g.:

Sub Main

    Dim lbls, lbl

    Dim point

    Dim x, y

    Dim i

    Set lbls = Document.ComponentSet("Labels").LabelSet

    For i = 0 To lbls.Count - 1

        Set point = lbls(i).Geom.Center

        x = point.X

        y = point.Y

        Application.MessageBox("(" & CStr(x) & ", " & CStr(y) & ")")

    Next ' i

End Sub

tjhb
10,094 post(s)
#11-Dec-12 00:53

This shows the source object ID and position (for linked labels) as well as the label position.

Sub Main

    Dim lbls, lbl

    Dim tiepoint, lblpoint

    Dim id

    Dim i

    Set lbls = Document.ComponentSet("Labels").LabelSet

    For i = 0 To lbls.Count - 1

        id = lbls(i).Link.ID

        'id = lbls(i).Link.Geom.Parent.ID ' equivalent

        Set tiepoint = lbls(i).Link.Geom.Center

        Set lblpoint = lbls(i).Geom.Center

        Application.MessageBox( _

            "Source object ID: " & CStr(id) & Chr(13) _ 

            & "Source object position: (" & CStr(tiepoint.X) & ", " & CStr(tiepoint.Y) & ")" & Chr(13) _

            & "Label position: (" & CStr(lblpoint.X) & ", " & CStr(lblpoint.Y) & ")" _

            )

    Next ' i

End Sub

mechalas

839 post(s)
#11-Dec-12 17:14

Interesting.

Given that the appearance of labels is dependent on the map/layout view, I am curious how it knows what to extract. If you had two different maps with the same label component in both, which configuration would this choose? I don't have Manifold in front of me right now so I can't tinker with it myself.

tjhb
10,094 post(s)
#11-Dec-12 19:32

John,

Given that the appearance of labels is dependent on the map/layout view

Do you mean the label display options? (Especially the X and Y offsets, the optimize alignment options and the resolve overlaps option.)

I think a label always has an inherent position, which the display options take as their starting point, adjusting it on the fly.

A label that is not linked has one inherent position.

A linked label has both an inherited position (from the object it is linked to) and an inherent position. These are the same by default. If the label is moved by editing, then the inherent position and the inherited position are different. But I don't think either depends on the label display options—that dependency is one-way.

(To complicate things unnecessarily.)

mechalas

839 post(s)
#11-Dec-12 22:45

To resolve overlaps, Manifold may or may not rotate labels for lines (if you have "render labels near short lines" selected), may or may not use leaders for points (if you have that option selected), may or may not shift point labels, and may or may not display labels at all. The overlaps are dependent upon the zoom level of the map, so how it shifts those labels is therefore also dependent on the zoom level.

The original poster is asking about preserving Manifold's overlap resolution. Since this is dependent upon the zoom level of the map, I don't see how a simple query can extract this information.

tjhb
10,094 post(s)
#12-Dec-12 00:46

You're quite right, I was missing most of the point.

Extracting manually adjusted positions is not hard, but extracting positions as adjusted by Manifold to resolve overlaps is not feasible.

atomek

422 post(s)
#12-Dec-12 10:31

if lables position is 'locked' by using "Render zoom" it does not get affected by current view, maybe then one can extract their 'optimized' location?

dchall8
1,008 post(s)
#27-Mar-14 15:07

I'm researching labeling solutions so this is a late entry to the original poster.

Depending on how many of these you have to do, here is a low-tech but tedious option. Take your new label points and drag them, one by one, until they superimpose over Manifold's resolved location labels. Having said that, I can't imagine that Manifold's algorithm for resolving overlaps would be as good as 'eyeballing' them yourself.

firsttube


1,439 post(s)
#27-Mar-14 18:31

I have since opted for another software to perform the labeling at the appropriate scales outside of Manifold. Then I can export the label points with rotation and label text as attributes in a shape file, and import into Manifold for labeling. As long as I set the labels up right in Manifold, it works amazingly well.


"The blessing in life is finding the torture you are comfortable with." - Jerry Seinfeld, 6/26/2013

danb

2,064 post(s)
#27-Mar-14 19:36

Are you able to share which software you use for the labels?


Landsystems Ltd ... Know your land | www.landsystems.co.nz

Sloots

678 post(s)
online
#28-Mar-14 08:36

Have a look at this video, demonstrating the capabilities of the Mppng Point Labeler add-in.

Cheers, Chris


http://www.mppng.nl/manifold/pointlabeler

firsttube


1,439 post(s)
#28-Mar-14 12:26

FME with MapTextLabeler option. Manifold does a really god job labeling the points that FME creates. I wrote a query to update the Rotation angle generated by FME, and in Manifold when you align labels to top and right, turn off "Resolve overlaps", it works great. You have to be aware of the actual height of your desired labels in ground units before creating them in FME. So you set the labels to render at your desired scale in Manifold, and actually measure the height of a capital letter. If you get an opportunity to try this technique let me know and I can post the rotation angle query and send some more tips.


"The blessing in life is finding the torture you are comfortable with." - Jerry Seinfeld, 6/26/2013

danb

2,064 post(s)
#28-Mar-14 19:52

Thanks for sharing. We have FME, but its a pretty expensive add on to get round a labeling deficiency. I'll give it a go when I get a chance.


Landsystems Ltd ... Know your land | www.landsystems.co.nz

firsttube


1,439 post(s)
#31-Mar-14 15:52

The value extends far beyond labelling. And with Manifold, the combination makes a great toolset.


"The blessing in life is finding the torture you are comfortable with." - Jerry Seinfeld, 6/26/2013

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