Skip to main content
Question

line on area


ohashkii
Contributor
Forum|alt.badge.img+8

Hi,
How can get the green dot on the blue polygons.
I have created the polygon centroid using center of polygon and with neighbor finder I get the green dot on red line. What I need the green dot on blue polygon and the small segment connecting the red line to blue polygons.
I tried lion on area but I cat extract the  segment marked in black.
Any help is appreciated

4 replies

danilo_fme
Evangelist
Forum|alt.badge.img+41
  • Evangelist
  • March 4, 2025

Hi ​@ohashkii 

 

Please, could you share the data or workspace template *.fmwt?

 

 

Thanks in Advance,

Danilo


rchoucroun
Contributor
Forum|alt.badge.img+10
  • Contributor
  • March 4, 2025

You’re pretty close. I’ve created a workflow that does what you want it to do, I think. 

  1. Create the centroid of the polygon using a CenterPointReplacer (this you’ve done already, but if your polygons are not rectangles or other regular shapes, your centroid may be outside the polygon (think of a U-Shaped polygon).
  2. Using the NeighborFinder, Create a line between the centroid and the line. Ensure the line is the candidate and the centroids are the base. Notice you will get new attributes called _closest_candidate_x, _closest_candidate_y, _closest_base_x, _closest_base_y. You can use these to generate lines segments from the centroids to your line. 
  3. Using the VertexCreator, add a point to the centroids, using the _closest_candidate_x, _closest_candidate_y attributes. 
  4. Use a Clipper to cut the full line to the boundary of the polygon. Your candidates are the new line segments you created. The Clipper is the original polygon. 

Here are my original polygon and lines.
 

And final output line segments:

 

And the full workflow:

 


ohashkii
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • March 4, 2025

Thanks....the clipper is fine...I did every thing except clipper....I have used neighbour finder for the green dot on the red line to polygon again ,so I got wrong polygon. 

 

Thanks again. 


ohashkii
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • March 4, 2025
rchoucroun wrote:

You’re pretty close. I’ve created a workflow that does what you want it to do, I think. 

  1. Create the centroid of the polygon using a CenterPointReplacer (this you’ve done already, but if your polygons are not rectangles or other regular shapes, your centroid may be outside the polygon (think of a U-Shaped polygon).
  2. Using the NeighborFinder, Create a line between the centroid and the line. Ensure the line is the candidate and the centroids are the base. Notice you will get new attributes called _closest_candidate_x, _closest_candidate_y, _closest_base_x, _closest_base_y. You can use these to generate lines segments from the centroids to your line. 
  3. Using the VertexCreator, add a point to the centroids, using the _closest_candidate_x, _closest_candidate_y attributes. 
  4. Use a Clipper to cut the full line to the boundary of the polygon. Your candidates are the new line segments you created. The Clipper is the original polygon. 

Here are my original polygon and lines.
 

And final output line segments:

 

And the full workflow:

 

BEST ANSWER


Reply


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