Skip to main content
Solved

Chopper vertex counter


I am using a chopper to extract vertices from lines. I want to get the order of these vertices for each line and have that stored in an attribute that I would like to copy to a csv along with the coordinates. I was able to get the coordinates but not the vertex order. What is the work around for this?

Best answer by ebygomm

If you just want to extract the coordinates then a coordinate extractor followed by a list exploder is another option, the element index attribute in the list exploder gives the vertex position

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

9 replies

takashi
Contributor
  • October 11, 2018

Hi @amina, you can use the Counter to add sequential number to the vertices output from the Chopper. If you set the counter name containing a value of unique ID attribute of the input lines, count number sequence will be created for each original line separately.


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • Best Answer
  • October 12, 2018

If you just want to extract the coordinates then a coordinate extractor followed by a list exploder is another option, the element index attribute in the list exploder gives the vertex position


  • Author
  • October 15, 2018
ebygomm wrote:

If you just want to extract the coordinates then a coordinate extractor followed by a list exploder is another option, the element index attribute in the list exploder gives the vertex position

Thank you for your help - I am trying the list exploder and attaching that after coordinate extractor. with indices{} as the list attribute but I am only getting 0 for the element index.. help will be appreciated thank you so much


takashi
Contributor
  • October 15, 2018
amina wrote:

Thank you for your help - I am trying the list exploder and attaching that after coordinate extractor. with indices{} as the list attribute but I am only getting 0 for the element index.. help will be appreciated thank you so much

Do you perhaps still have the Chopper in the workflow? If you adopt the CoordinateExtractor and the ListExploder, you don't need to use the Chopper any longer.

 

 


  • Author
  • October 16, 2018
amina wrote:

Thank you for your help - I am trying the list exploder and attaching that after coordinate extractor. with indices{} as the list attribute but I am only getting 0 for the element index.. help will be appreciated thank you so much

Hi @takashi

 

I originally have a feature class of lines that I want to extract the vertices and the coordinates for. I was thinking the chopper will split up by Vertex then the coordinateextractor is giving me the coordinates. The List exploder split the coordinates up. The only thing I am still missing is the Vertex number for each line. The counter is not looping through the whole set and I am not setting it up properly I believe.

  • Author
  • October 16, 2018
ebygomm wrote:

If you just want to extract the coordinates then a coordinate extractor followed by a list exploder is another option, the element index attribute in the list exploder gives the vertex position

Hi @egomm I am getting for element index. What would I be missing? Thanks

ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • October 16, 2018
amina wrote:
Hi @egomm I am getting for element index. What would I be missing? Thanks

 

As @takashi mentioned, if you just want to extract the coordinates you don't need the chopper. That will turn your lines into points which of course only have one coordinate which is why the element index is showing 0.

 

 

Send the lines straight into the coordinate extractor

takashi
Contributor
  • October 16, 2018
ebygomm wrote:

If you just want to extract the coordinates then a coordinate extractor followed by a list exploder is another option, the element index attribute in the list exploder gives the vertex position

The upper workflow is my first suggestion, assuming that the input lines have unique ID attribute called e.g. "_line_id".

 

The lower workflow is @egomm's suggestion, don't need to use the Chopper.

 


  • Author
  • October 16, 2018
takashi wrote:
The upper workflow is my first suggestion, assuming that the input lines have unique ID attribute called e.g. "_line_id".

 

The lower workflow is @egomm's suggestion, don't need to use the Chopper.

 

@takashi

 

thank you so much I got it now- It is working like a charm the key was to assign the counter name to the unique line_id .. I am sorry to have taken so long to get this straight I have not worked in FME for years and I am just getting back to it. This forum is so great.. Thank you so much for all your help

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