Skip to main content
I have built an FME workbench that translates Ordnance Survey's MasterMap Topographic layer into MapInfo Professional TAB format.

 

 

Most features translate fine (once you get passed the line style issue with the MapInfoStyler transformer!) but I am having particular issues with the CartographicText feature type.

 

 

The GML format that Ordnance Survey provide their product in contains an attribute to set the anchorPosition of the text but I cannot get this to be recognised by MapInfo Professional at all.  I originally thought that using AttributeCreator to set the mapinfo_text_justification might do it but this just sets the justification within a block of text, not the original anchor position.

 

 

I'm pretty new to FME so there might well be something I'm missing but after having tried a number of different transformers I'm getting the feeling that it might be a limitation of MapInfo Professional and not FME.

 

 

Does anybody have any bright ideas?
Hi Darren,

 

 

Have you tried the LabelPointReplacer transformer?

 

 

Takashi
Hi Takashi,

 

 

Yes, I've tried that one, unfortunately it only allows for the setting of the text height and rotation.  What I need is something that enables me to either;

 

- create the text within FME and be able to set the position of the text relative to the geographic point, or

 

- create a MapInfo specific format attribute that enables me to set the position of the text in a similar manner.

 

 

For example, at the moment I am using attribute creator to set the following (MapInfo interprets these);

 

- mapinfo_text_string

 

- mapinfo_text_height

 

- mapinfo_text_fontbgcolor

 

- mapinfo_text_fontfgcolor

 

- mapinfo_text_fontname

 

- mapinfo_rotation

 

- mapinfo_type

 

 

Does anybody know of any additional format attributes that I could add to give me control over the position of the text?

 

 

Many thanks

 

 

Darren
Hi Darren,

 

 

do you, perhaps, have the X,Y coordinate of the anchor position as a numeric attribute for each label? If you, you could use the 2DPointReplacer to replace the geometry with a point at this coordinate.

 

 

If I have misunderstood, please consider posting some more info or, preferrably, a screenshot of your attributes.

 

 

David
Hi David,

 

 

Yes, I do have the x/y coordinates for the anchor position, the problem I have is that all text is being anchored on the bottom/left whereas I want to be able to set this to be centre/centre but cannot find how to do this.

 

 

Many thanks

 

 

Darren
Hi Darren,

 

 

I assume you have succeeded in creating a text feature from coordinates (x0, y0). If you can move (offset) the text feature so that the point (x0, y0) will be its center, is your problem solved?   The sleleton of my idea is: 1) Create the center point of the text feature. (CenterPointReplacer) 2) Extract coordinates (x1, y1) of the center point. (CoordinateExtractor) 3) Calculate the offset values (x0 - x1, y0 - y1). (AttributeCreator or ExpressionEvaluator) 4) Offset the text feature by the offset values. (Offsetter)

 

Takashi
Hi,

 

 

it is difficult to give specifics when we know so little about your input data (not everyone here knows OSM data :-)

 

 

Could you perhaps give us a specific example of your input (geometry and attributes) and what you would like as a result?

 

 

David
Hi Darren

 

 

I struggled with similar issues recently.

 

 

To my understanding (I have to say I only read the available online docu of Mapinfo and never used it) it is not possible to align a text center/center in Mapinfo.

 

 

For center/center I use mapinfo_text_justification=center and calculate a vertical offset depending on the text-size and apply the shift with Offsetter transformer.

 

 

Text-size also seems to be different in Mapinfo compared to what other formats use and do.

 

 

Michael
If there is a way I'd be interested to hear it.

 

 

In a similar workspace I have, text with anchor position of 4 (I think that's the centre one) is offset by in both x and y directions. The amount of this offset seems to be calculated using text height and rotatation (It's a long time since I set this up, I suspect there was a fair amount of trial and error in this process)

Reply