Skip to main content
Solved

Align label with line

  • July 28, 2020
  • 11 replies
  • 144 views

@takashi

Hi !

Any hints how to align label with the line direction ? I'm using a 2DVectorCalculator, Featuremerger, offsetter and vertex creator. But I'm not always having the right orientation of my labels with the line direction. See below attached images. Thank you in advance.

Best answer by caracadrian

The Forum becomes Read only in a few minutes (https://knowledge.safe.com/questions/117555/important-notice-community-migration-service-outag.html ) so email me at if you have further questions

@sam.27​ You should start with the ProfileGenerator custom transformer, right click it and than click edit. Copy paste everything in your workspace, than customize to your needs.

Customise ProfileGenerator

The red bookmark that I created is an idea of what you need. You label the vertexes and offset them with something constant (constant + z*VerticalExageration - or @YValue*VerticalExageration).

For partial distances you Chop by 2 vertexes, generate the 2D measure of each line, label it and offset that label to the place you need it to be.

Please mark the question as answered, I want to know what the new badges look like :D

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

11 replies

caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • 571 replies
  • July 28, 2020

Can you tell us what are you trying to label?

For line labeling you can use the Labeller transformer.

For labeling points with the orientation of the line you can also use the NeighborFinder to get the angle and than the LabelPointReplacer


  • Author
  • 19 replies
  • July 28, 2020

I'm labelling the attribute showing depth at each vertex.


caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • 571 replies
  • July 28, 2020

You can get something like this:with this:

I input a 3Dpolyline that I chop in to vertexes than I get their neighbor, label the vertexes and set their rotation via the fme_rotation attribute.

If you want to set the rotation to the angle of the line that goes from the previous vertex to the next vertex you can create attributes for X and Y, than Enable adjacent feature attributes in an AttributeManager and do the math (atan(dX/dy) plus or minus depending on x and y grater than or less than 0, you have 4 situations. Don't forget about pi()/180...)


  • Author
  • 19 replies
  • July 28, 2020

Oh great! It works very well ! Thank you.

I have another question, do you know if it is possible to create label shown in rectangle from the figure below: It's a DWG file.


caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • 571 replies
  • July 28, 2020

Oh great! It works very well ! Thank you.

I have another question, do you know if it is possible to create label shown in rectangle from the figure below: It's a DWG file.

Sure, just use a lot of LabePoinReplacers coupled with Offseters, get the BoundingBox, draw the line.

Here is a demo workspace labelpointinbox.fmwt


caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • 571 replies
  • July 28, 2020

Oh great! It works very well ! Thank you.

I have another question, do you know if it is possible to create label shown in rectangle from the figure below: It's a DWG file.

The Forum becomes Read only in a few minutes (https://knowledge.safe.com/questions/117555/important-notice-community-migration-service-outag.html ) so email me at if you have further questions


  • Author
  • 19 replies
  • August 6, 2020

The Forum becomes Read only in a few minutes (https://knowledge.safe.com/questions/117555/important-notice-community-migration-service-outag.html ) so email me at if you have further questions

Hi Adrian,

Thanks a lot, I've added a buffer to keep the characters inside the label not too close to the border!

Could you please help me with another Issue, I need to make an elevation profile of a pipeline like in the attached dgn file.

Thanking you in advance.

 


caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • 571 replies
  • Best Answer
  • August 6, 2020

The Forum becomes Read only in a few minutes (https://knowledge.safe.com/questions/117555/important-notice-community-migration-service-outag.html ) so email me at if you have further questions

@sam.27​ You should start with the ProfileGenerator custom transformer, right click it and than click edit. Copy paste everything in your workspace, than customize to your needs.

Customise ProfileGenerator

The red bookmark that I created is an idea of what you need. You label the vertexes and offset them with something constant (constant + z*VerticalExageration - or @YValue*VerticalExageration).

For partial distances you Chop by 2 vertexes, generate the 2D measure of each line, label it and offset that label to the place you need it to be.

Please mark the question as answered, I want to know what the new badges look like :D


caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • 571 replies
  • August 6, 2020

The Forum becomes Read only in a few minutes (https://knowledge.safe.com/questions/117555/important-notice-community-migration-service-outag.html ) so email me at if you have further questions

Meh.. I liked the old forum badges better


  • Author
  • 19 replies
  • August 6, 2020

🙂 Thanks again for your help ! Have a nice day Adrian !


caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • 571 replies
  • August 6, 2020

🙂 Thanks again for your help ! Have a nice day Adrian !

Anytime