I have 18 polygons in a database. I want to retrieve the x and y value of each CenterPoint of the shorter side of each polygon (approximately where the red dot is on image). I also want to create a new attribute called sequence. The first polygon on the left should get the value 1, the second value 2, the third one value 3 and so on. How can I achieve this ?
Page 1 / 1
Hi @katt,
To sequence, use a BoundsExtractor to get the XMax of the polygons, then a Sorter to sort on XMax, ascending. After sorting, use a Counter to assign the sequence number.
Hi @katt,
To generate the center points:
- Dissolver to dissolve all the polygons into one
- GeometryCoercer to convert new polygon to line
- Chopper to chop into 2-vertex segments
- LengthCalculator to calculate length of segment
- Sorter to sort by length, descending
- Sampler to Sample First N Features and Sample rate of 2
- Use NotSampled output of Sampler to get the short segments only
- CenterpointReplacer with Mode Center Point of Bounding Box to get center point of segments