Hi @od10 ,
Just to confirm here, does your list contain the coordinate pairs or the indices for the vertices you want to remove?
If the latter, try the attached workspace. I'll try to summarize what's happening it in as few words as possible below:
You'll need to loop for this to work. One way of accomplishing this is to use a custom transformer with a loop output. Alternatively, you can also accomplish this using the WorkspaceRunner and calling a child workspace but that will likely be a bit slower.
Using the custom (looping) transformer, will look something like this:
Where you are performing an iterative loop to remove one vertex after another. You'll need to adjust the parameter values to point them to your list containing the indices you want to remove. The way this works is for every loop, the VertexRemover is dynamically being set to step through each element in your vertex to remove list using the following expression:
@Value(VertexToRemove{@Value(_count)}._creation_instance)-@Value(_count)
This expression sets the list element based on the current iteration of the loop (note it subtracts the count to account for the next time the feature is passed into the loop). For the screenshot below, each red notch indicates a vertex that was removed.
Same feature with preserve geometry set to no. Try it out and let me know if it works. If it doesn't and you are able to share a sample feature, I'd be happy to take another look.
Other helpful resources:
Hi chrisatsafe,
In the end I used a pythoncaller to loop through the list of vertices and removed them in descending order.
Thanks for the help.