Skip to main content

Hello,

I am trying to insert vertices at the end of lines, using the vertexcreator and 'insert point at index'.

To do this I am using -1 for the index, but this adding the vertex at the point one before last (see image).

How can I get the extra vertex to be at the end?

Thanks,

Owen

Have you tried the Add Point option instead of the Index one?


Try the Snipper, with vertex option, start and end set to -1 and -1.


Have you tried the Add Point option instead of the Index one?

Thanks, I hadnt thought of that. I was successfully adding points at the start index with 0 so thought -1 would work for the end as well

 

 


Thanks, I hadnt thought of that. I was successfully adding points at the start index with 0 so thought -1 would work for the end as well

 

 

I see your logic, in fact I assumed that that would work as well... @NatalieAtSafe, could you check with the developers to see if this is expected behaviour?

 


Thanks, I hadnt thought of that. I was successfully adding points at the start index with 0 so thought -1 would work for the end as well

 

 

In my understanding, the logic of the "Insert Point At Index" is "to insert a new point BEFORE a vertex specified by index". If you set 0, a new point will be inserted before the start node. As well, since -1 indicates the last vertex, I think the behavior is reasonable.

 

If you need to add a new point AFTER the last vertex, you need to use "Add Point" mode anyway.

 

 


Have you tried the Add Point option instead of the Index one?

@takashi and @redgeographics are correct. Specify 0 with "Insert Point at Index" to insert a vertex at the beginning of a feature or "Add Point" to add it to the end.

 

Currently if a negative value is set for "Insert Point at Index" which is >= the number of coordinates then the feature will be rejected with an fme_rejection_code of INVALID_PARAMETER_INDEX.