Skip to main content
Hi guys!   I used Labeller to put a text in a street and I got success (1 and 2) , but my customer required the text centralized (3 and 4).   The Labeller starts the text in Mid Point, so, how do I centralize the text?   Purple Line: Bounds Green Point: Mid

 

 

Hi,

 

 

a couple of ideas:

 

  • If you need more powerful capabilities, there is a for-pay transformer MapTextLabeller
David
Hi,

 

 

 

If you are writing to a format that supports text justification, you can try to manipulate the corresponding  format attributes.

 

 

Itay
Hi All.

 

 

You can center your text by finding its insertion point and orientation in relation to the streetgeometry.

 

 

For this i do something like this:

 

 

1. Strroke the text.

 

2 deaggregate it, with setting to split surfaces/solids.

 

3 Boundingboxaccumulater.

 

4 from bounind boxaccumulator you can extract all data u need.

 


Hi all.

To do that i do something like:

 

1. stroke text

 

 deaggregate  it, with setting split surfaces/solids.

 

 boundingboxaccumulator (no group by)

 

 from resulting bounding box u get centerline, centerpoint, orientation and insertionpoint (wich is left bottomcorner of BB).

 

2. with the line and orientation u can aquire inersections with streetboundary if  you have them as polygons.

 

 if you already have streetcenterlines (axis) you can just affine/move center of bounding box to intersection of axis with centerline of boundingbox.

 

You can also test wether the text fits into the street and recalculate if needed fontsize if needed or make it multiline.

You will end up with insertionpoints for your text. The stroked text is just for calculationpurposes. (unless you want to "flow" your text. This i do with the stroked fonts)

 

Have fun.
soz for double post, but IE was like bugging me...ehehe (that's why first is just partialy completed)
Hey Guys!

 

 

I solved 95% of the problem.

 

 

I did these steps:

 

The CentredLabelAdder offsets the street name close to street (it causes overlaps), so I set 'Label Offset' value multiplied by 1.5.

 

20 x 1.5 = 30

 

 

 

Black text: New street name

 

Red text: Old street name

 

Green point: Street center point

 

Purple line: Street bound

 

Brown line: Street

 

 

 

 

 

@David: CentredLabelAdder works! (;

 

 

@Itay: It does not work for me, because I did not have the street. I create this using the street (feature) + Labeller (I tested in Smallworld GUI and set center align for the annotation).

 

 

@Gio: I need the text feature, TextStroke transforms text into line feature.

 

 

 

Thanks all for help!!!
*** EDIT ***

 

 

Before CenteredLabelAdder I used LineJoiner with group by 'Street Name'
I use the geometry for placement and calculation.

 

But still retain retain text, its just an attribute u can acces and turn to a textobject whenever u want, and of course insertion point and boundingboxes fo desired font. No data need to be lost in this proces.

 

 

My script was more concerned to "flow" text along lines and fit em snugly in steetpolys.

 

Also, graphical generation is faster then text btw.

 

 

2012 doenst have a centredlabeler (afaik). And only part of Leiden (where i live) street geometry has symetrical streets anyway.

 

Fitting streetname on crossection of a street is not very usefull on our maps.

Reply