Showing results for 
Search instead for 
Do you mean 

How do you set GeoMedia Label orientation to symbol orientation automatically?

by Technical Evangelist on ‎07-18-2016 06:58 AM (608 Views)

Question

How do you set GeoMedia Label orientation to symbol orientation automatically?

 

I’m trying to create Labels over existing symbols using ‘Insert – Label in GeoMedia. Label was created with ‘Orient to geometry’ (orientation) because I need it to have the same angle as the symbol.

 

The problem is that if symbol angle makes label oriented down and it's not possible to read label text then label orientation changed automatically to the opposite.

 

And I need to keep label angle, even if its 3 radians for example and label text is overturned.

 

Is it possible to keep label oriented exactly the same as symbol it's created for without this automatic changing of orientation to the opposite?

Answer

For labels it will be Input.Offset (the geometry attribute name that is generated by labels command). I worked on a similar problem where I was trying to place the label based on the orientation of a line (contour actually) so that the label is always up ( and along the line) and easy to read.

 

For readability I am providing it as below. Also look in nested IF statement documentation in help or working with doc.

 

IF(Output.Segment_Angle <= 90 THEN (90-Output.Segment_Angle)
ELSEIF(Output.Segment_Angle > 90 AND Output.Segment_Angle <= 180 THEN 450-Output.Segment_Angle
ELSEIF(Output.Segment_Angle > 180 AND Output.Segment_Angle <= 270 THEN 270-Output.Segment_Angle
ELSE 630-Output.Segment_Angle))) ENDIF

 

For your example:

 

ORIENTATION(Input.Offset) executed in label functional attribute returns label angle. This angle was already corrected automatically which is why I could not use it. Symbol geometry was not available.

 

Therefore I created functional attribute query over symbol returning symbol Input.Geometry to include it into available fields.

 

Then I created label over this symbol functional query.

 

Then created functional query on this label. In this functional query I used symbol geometry as a parameter of ORIENTATION function.

 

Finally expression was like this:

IF(ORIENTATION(Input.G3E_GEOMETRY)<-90, SPIN(Input.Offset, -180), IF(ORIENTATION(Input.G3E_GEOMETRY)<0, SPIN(Input.Offset, 180), Input.Offset))

 

Now labels on my screen have the same rotation as symbols they created over.

Contributors