Skip to main content
Solved

How to add points with numbers (1,2,3,4,......) over each point in pdf file

  • September 9, 2021
  • 7 replies
  • 11 views

spiderman
Contributor
Forum|alt.badge.img+7

How to add points with numbers (1,2,3,4,......) over each point in pdf file .

i have 20 points and i would like to write in pdf file but i have to count points and add the counting over each point .

and what is the best method to resize the point ?

How could i achieve that ?

 

Thanks for help

Fme 2018

 

 

Best answer by f.kemminje

spiderman wrote:

thanks ,i will try it .

but how i put the numbers above a little bit of each required point .

Add delta x and y to the point. And add label point replacer with text and newly created delta x and y. For example create new xy attribute add x+0.005 and y+ 0.005 for the existing point. Then use this new point for label point replacer. Thanks F. Kemminje
View original
Did this help you find an answer to your question?

7 replies

caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • September 9, 2021

Use Counter to number the points, LabelPointReplacer to create the text and PDFStyler to confugure text style (font, size, color)


spiderman
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • September 9, 2021
caracadrian wrote:

Use Counter to number the points, LabelPointReplacer to create the text and PDFStyler to confugure text style (font, size, color)

thanks for reply ,but how could i achieve to add a number over the point ,position of numbers . i have found points that intersecting between lines and border of polygon so i would like to show this point on polygon at pdf file and upper each point has specific number that we have already counted .

 

so i want to show points at pdf file and also number upper each point .


caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • September 10, 2021

I don't really understand what you are trying to accomplish. But for the most of it, you seem to be in one of the following situations:

Offset text from polygonIn red are the labels centered on the vertices and in blue are the labels offset to the outside of the polygon.

In either way you have some processing to do.

For the red situation, label centered on the vertex:

  • use LabelPointReplacer folowed by TextStroker (specify Font Name, style and size), CenterPointReplacer (set to Center Point of Bounding Box)
  • use the output from LabelPointReplacer as Base and the output of CenterPointReplacer as Candidate in a NeighborFinder with GroupBy enabled and set to the _count attribute
  • send the output from MatchedBase to Offseter set to Polar Coordinates with Distance set to -@Value(_distance) and Polar angle set to _angle
  • use the output from Offsetter and the original polygon to create your PDF

For the blue case, labels outside polygon (you have to do some calculation using the typography point size, 0.3528mm, set to the scale you want to output to your PDF):

  • use a Bufferer on your polygons set to font size x 0.3528 x scale nominator (you can do a few tests and get a value that fits most of the situations)
  • send the output to Generalizer set to Douglas and tolerance font size x 0.3528 x scale nominator + 10%
  • sent that to a Chopper set to By Vertex and Max vertices 1
  • to counter
  • to Label Point Replacer and sent this to PDFStyler

I have also attached a workspace that contains both cases (except the typography point size, you figure that out).


spiderman
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • September 11, 2021
caracadrian wrote:

I don't really understand what you are trying to accomplish. But for the most of it, you seem to be in one of the following situations:

Offset text from polygonIn red are the labels centered on the vertices and in blue are the labels offset to the outside of the polygon.

In either way you have some processing to do.

For the red situation, label centered on the vertex:

  • use LabelPointReplacer folowed by TextStroker (specify Font Name, style and size), CenterPointReplacer (set to Center Point of Bounding Box)
  • use the output from LabelPointReplacer as Base and the output of CenterPointReplacer as Candidate in a NeighborFinder with GroupBy enabled and set to the _count attribute
  • send the output from MatchedBase to Offseter set to Polar Coordinates with Distance set to -@Value(_distance) and Polar angle set to _angle
  • use the output from Offsetter and the original polygon to create your PDF

For the blue case, labels outside polygon (you have to do some calculation using the typography point size, 0.3528mm, set to the scale you want to output to your PDF):

  • use a Bufferer on your polygons set to font size x 0.3528 x scale nominator (you can do a few tests and get a value that fits most of the situations)
  • send the output to Generalizer set to Douglas and tolerance font size x 0.3528 x scale nominator + 10%
  • sent that to a Chopper set to By Vertex and Max vertices 1
  • to counter
  • to Label Point Replacer and sent this to PDFStyler

I have also attached a workspace that contains both cases (except the typography point size, you figure that out).

thanks for workspace but it is not compatible with my version because i have version 2018

 

as shown as image ,i would like to define the point that (intersecting from lines and polygon ) and declare the point and over each point add counting number for intersecting black lines and for intersecting red lines declare also points and add (a,b,c,d,...)depend on amount of points .

i have no problem to get points ,but my problem i want to add numbers or alphabet over geometry of each point then write in pdf file . thanks alot for help

FME 2018

example


f.kemminje
Contributor
Forum|alt.badge.img+11
  • Contributor
  • September 11, 2021

@spiderman​ You can Use counter transformer for the points output. If you need alpha, then you may need to write small python where you can convert 1 to a , 2 to b ... something like that. Hope I understood your requirement.


spiderman
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • September 13, 2021
f.kemminje wrote:

@spiderman​ You can Use counter transformer for the points output. If you need alpha, then you may need to write small python where you can convert 1 to a , 2 to b ... something like that. Hope I understood your requirement.

thanks ,i will try it .

but how i put the numbers above a little bit of each required point .


f.kemminje
Contributor
Forum|alt.badge.img+11
  • Contributor
  • Best Answer
  • September 13, 2021
spiderman wrote:

thanks ,i will try it .

but how i put the numbers above a little bit of each required point .

Add delta x and y to the point. And add label point replacer with text and newly created delta x and y. For example create new xy attribute add x+0.005 and y+ 0.005 for the existing point. Then use this new point for label point replacer. Thanks F. Kemminje

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings