Skip to main content

I believe the CoordinateReplacer transformer can do just that.


Hi @amandab, I don't think there is a transformer to do that at once, but you can use the CoordinateRemover to remove a vertex from a line and the VertexCreator to add a vertex at the end of a line. So, assuming that attributes storing coordinates of new start and end nodes have been merged to the line features already, this procedure may be a possible way.

  1. CoordinateRemover: Remove the last vertex.

  2. VertexCreator (Mode: Add Point): Add the new end node.

  3. Orientor: Reverse the orientation.

  4. CoordinateRemover_2: Remove the last vertex.

  5. VertexCreator_2: Add the new start node.

  6. Orientor_2: Reverse (Restore) the orientation.

Hi @amandab,

In case you are working with a database format and the line ID and new XY are identical, you can create new lines from the points and update the existing geometry in the database with the help of the common ID.


I believe the CoordinateReplacer transformer can do just that.

Not quite. The CoordinateReplacer transformer searches for all instances of a coordinate value, and replaces them, axis independent. So if I enter 0 for my x and y values to replace with -1, then all the 0's will be replaced, not just 0,0. ex. 0, 10 -> -1, 10.

 

 


The VertexCreator has a mode Replace Point at Index which should do want you want.

 

The start index is 0, then end index is -1.

The VertexCreator has a mode Replace Point at Index which should do want you want.

 

The start index is 0, then end index is -1.
Note that you will have to extract the coordinates of the points to attributes and merge them onto the line layer using the ID.

The VertexCreator has a mode Replace Point at Index which should do want you want.

 

The start index is 0, then end index is -1.
I forgot the option. It's the best way, I think.

 

 


Thanks everyone, those are quite a few options to try, that's great. This was my first post, I'm pleasantly surprised at the quick response!


Ok, looks like this worked:

Extracted the coordinates for the points (specify coordinate), and the lines (All Coordinates), featuremerged them together (using both merged and unmerged in case some lines were missing a start or end matching point) and created new attributes to make sure the xy for the start points and end points were in individual fields. Then used VertexCreator to create a new start point (replace point at index, for index = 0), and used VertexCreator to create a new end point (replace point at index, for index = -1). That really seems to have done the trick.

Thanks again everyone!


Hi @amandab,

In case you are working with a database format and the line ID and new XY are identical, you can create new lines from the points and update the existing geometry in the database with the help of the common ID.

No, not directly from a database. Using MapInfo files, actually. Good to know, though, as I sometimes do work with database format.

 

 


Reply