Skip to main content
Solved

Can I replace the start and end points of a line with other point xy's, from a point data layer? The ID of each start and end point are individual attributes in the line layer, which correspond to the appropriate ID of the point in the points data.

  • April 28, 2017
  • 10 replies
  • 218 views

Forum|alt.badge.img

Best answer by jdh

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.
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

10 replies

erik_jan
Contributor
Forum|alt.badge.img+23
  • Contributor
  • April 28, 2017

I believe the CoordinateReplacer transformer can do just that.


takashi
Celebrity
  • April 28, 2017

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.

itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • April 28, 2017

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.


jdh
Contributor
Forum|alt.badge.img+40
  • Contributor
  • April 28, 2017

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.

 

 


jdh
Contributor
Forum|alt.badge.img+40
  • Contributor
  • Best Answer
  • April 28, 2017

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.

jdh
Contributor
Forum|alt.badge.img+40
  • Contributor
  • April 28, 2017

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.

takashi
Celebrity
  • April 28, 2017

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.

 

 


Forum|alt.badge.img
  • Author
  • April 28, 2017

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!


Forum|alt.badge.img
  • Author
  • April 28, 2017

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!


Forum|alt.badge.img
  • Author
  • April 28, 2017

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.