Question

Start, Mid and End point from Line and Polygon dataset

  • 8 November 2022
  • 3 replies
  • 5 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

Userlevel 3
Badge +26

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

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

Badge +2

@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

Reply