Skip to main content
Solved

Numbering a polygon's vertices by their order


Forum|alt.badge.img

Hi all,

I have to extract the coordinates of some polygons' vertices from an SDE feature class and write them into a database table. The vertices have to be numbered according to their order in the polygon. I'm using the Chopper and the Geometry Extractor to get the vertices and their coordinates. However I didn't find a possibility to save a number for each vertex. For each polygon I'm transforming the numbering has to start with 1 of course. I first tried the Counter, but I can only get consecutive numbers for all vertices with it. Can I make the Counter start with 1 again when for each new Polygon or is there any other Transformer that can do the job?

Thanks in advance for any hints!

Best answer by ebygomm

A coordinate extractor followed by a list exploder is an easier way of acheiving this. After exploding the list the element_index attribute will contain the coordinate position

View original
Did this help you find an answer to your question?

8 replies

nielsgerrits
VIP
Forum|alt.badge.img+54

Place a Counter directly behind the Chopper. Select the unique ID of the geometry in the field Counter Name.


david_r
Evangelist
  • December 5, 2017

You can use the Counter setting "Counter name" which works like a Group By.

You can for example set the counter name to the polygon OBJECTID to have the numbering restart for each polygon.


Forum|alt.badge.img+1

@ kgt_lena, you can specify an attribute value as the Counter Name in the counter transformer to give you a group by/base count. So your workflow might be like in the image below - a first Counter that calculates a value/id per polygon, and then after you have the vertices as points a second Counter that calculates a value/id per point restarting at each change in polygon id.

capture.png

calculate-points-with-counts.fmw


ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • Best Answer
  • December 5, 2017

A coordinate extractor followed by a list exploder is an easier way of acheiving this. After exploding the list the element_index attribute will contain the coordinate position


Forum|alt.badge.img
  • Author
  • December 6, 2017
david_r wrote:

You can use the Counter setting "Counter name" which works like a Group By.

You can for example set the counter name to the polygon OBJECTID to have the numbering restart for each polygon.

Thanks @david_r, your solution works fine for me :-)

 


Forum|alt.badge.img
  • Author
  • December 6, 2017
nielsgerrits wrote:

Place a Counter directly behind the Chopper. Select the unique ID of the geometry in the field Counter Name.

Thank you, too, @nielsgerrits, that's quite the same approach david_r suggested and it works fine!

 


Forum|alt.badge.img
  • Author
  • December 6, 2017
1spatialmary wrote:

@ kgt_lena, you can specify an attribute value as the Counter Name in the counter transformer to give you a group by/base count. So your workflow might be like in the image below - a first Counter that calculates a value/id per polygon, and then after you have the vertices as points a second Counter that calculates a value/id per point restarting at each change in polygon id.

capture.png

calculate-points-with-counts.fmw

Thanks @1spatialmary, I didn't know about that grouping functionality - it's exactly what I was looking for :-)

 


Forum|alt.badge.img
  • Author
  • December 6, 2017
ebygomm wrote:

A coordinate extractor followed by a list exploder is an easier way of acheiving this. After exploding the list the element_index attribute will contain the coordinate position

Thank you, @egomm! This is indeed an easier way.

 


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