Skip to main content
Solved

Numbering a polygon's vertices by their order

  • December 5, 2017
  • 8 replies
  • 94 views

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

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

8 replies

nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2940 replies
  • December 5, 2017

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


david_r
Celebrity
  • 8394 replies
  • 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
  • 59 replies
  • December 5, 2017

@ 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+44
  • Influencer
  • 3434 replies
  • 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
  • 11 replies
  • December 6, 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.

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

 


Forum|alt.badge.img
  • Author
  • 11 replies
  • December 6, 2017

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
  • 11 replies
  • December 6, 2017

@ 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
  • 11 replies
  • December 6, 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

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