Skip to main content

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!

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


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.


@ 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


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


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 :-)

 


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!

 


@ 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 :-)

 


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.

 


Reply