Skip to main content
Question

Start, Mid and End point from Line and Polygon dataset

  • November 8, 2022
  • 3 replies
  • 89 views

I want to get the Start, Mid and End point from:

 

1. A line dataset (Roads)

2. A polygon dataset (Roads)

 

What is the easiest way to process this?

 

(The polygon dataset is in the shape of roads, so looking at the start, mid and end point of the road as we see it!)

3 replies

dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • 627 replies
  • November 8, 2022

One way is with a few Snipper transformers, setup as the screen shot below. '0' is the first vertex, '-1' is the ending vertex, and you can use the Distance (percentage) mode to get the mid-point (50%). For the polygons, you can use the CenterlineReplacer first, and then send those linear features through the same process.image


  • Author
  • 1 reply
  • November 8, 2022

One way is with a few Snipper transformers, setup as the screen shot below. '0' is the first vertex, '-1' is the ending vertex, and you can use the Distance (percentage) mode to get the mid-point (50%). For the polygons, you can use the CenterlineReplacer first, and then send those linear features through the same process.image

Thank you @dustin​  I'll try this out


Forum|alt.badge.img+2
  • 1891 replies
  • November 8, 2022

@saqib.amin​  a combination of CenterPointExtractor and a pair of CoordinateExtractor's should do the trick. For polygons, use GeometryCoercer to coerce the polygon into line otherwise you'll get the center of the area instead of along the line