Skip to main content
Question

How to create a label based on a line based on a relationship between 2 points

  • April 28, 2023
  • 1 reply
  • 34 views

gmbutler2
Contributor
Forum|alt.badge.img+10

I have shapes that butt up against each other and I need to create labels at the edge where the two shapes meet. These shapes could contain up to a large number on incalculable edges that meet, for example the edges of state polygons. I figure my best guess is to take the shape and create a center point in the middle of the shape that is always inside the polygon. I then take the polygon and chop them so I have individual lines. Then I can take the points and compare them where they have different names and identify the point of intersection between these points along the edge lines.

I am probably overthinking but trying to figure out the best way. See simple example explanation below.

Example.​imageThe left shape I call Shape A. The right shape I call Shape B. I have identified the centers of each shape creating points. I want to use an imaginary line between the two points and identify the edge where this imaginary line instersects. At that intersection, using a CenterPointReplacer for the line, I want to create 2 labels, one for Shape A and one for Shape B. There will be 2 lines on top of each other here with different Name attributes. So both lines would be replaced with the point to create a label.

 

How do I do this? Is this even possible? Any help is greatly appreciated! Thank you!

1 reply

daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • April 28, 2023

Hi @gmbutler2​,

I think the TopologyBuilder can help you, by building an arc/node topology from the input polygons. The edges output will have the information from the left and right polygons they are part of.

Screen Shot 2023-04-28 at 3.28.58 PMUse a Tester to find edges with both left and right information, then use the Labeller to label them with the appropriate state names.


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