Skip to main content
Solved

How can I copy vertices at lines intersections (not segmented lines)


Forum|alt.badge.img

Hi all,

I have a file with polylines which intersect but not segmented at the intersection and I’d like to find the vertices coordinates or have a points file from this vertices.. Any idea?

Thanks

Best answer by erik_jan

OK, Then after generating the Nodes using the InterSector, use a Chopper to generate the vertices from the lines and test if each node is on a vertex from the line using a PointonPointOverlayer.

See attached image:

View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, 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.

7 replies

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • January 21, 2016

Use the InterSector transformer to create the nodes and the use only the Node output port.

Disregard the Intersected lines output port.


Forum|alt.badge.img
  • Author
  • January 21, 2016

thanks for answer ... sorry .. the question was not correct.. I want to create points if there is a vertices at the intersection but I do not want to create points if there is no vertices..


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • Best Answer
  • January 21, 2016

OK, Then after generating the Nodes using the InterSector, use a Chopper to generate the vertices from the lines and test if each node is on a vertex from the line using a PointonPointOverlayer.

See attached image:


takashi
Influencer
  • January 22, 2016

If the requirement is to split the lines only by the existing vertices that are shared by two or more different lines, this data flow might work.


takashi
Influencer
  • January 22, 2016
takashi wrote:

If the requirement is to split the lines only by the existing vertices that are shared by two or more different lines, this data flow might work.

If the goal is to create points that match vertices shared by two or more lines, desired points will be output through the SingleMached port of the Matcher.


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • January 22, 2016

You can also do following.

Extract end and startpoint of lines.

Then relate the lines using for instance a spatialrelator. Make sure to first rename one the coordinate sets ( either candidate or requestor) In the following expression i used S for startvertex and E for endvertex. THen i use a suffix _t to distinguish crossing lines.

Then just calculate the intersection (basic math realy..)

intersection (Ix,Iy) :

AttributeCreator_3 [AttributeCreator]

 

Ix = @Evaluate(((@Value(Sx)*@Value(Ey)-@Value(Sy)*@Value(Ex))*(@Value(Sx_t)-@Value(Ex_t))-(@Value(Sx)-@Value(Ex))*(@Value(Sx_t)*@Value(Ey_t)-@Value(Sy_t)*@Value(Ex_t)))/(((@Value(Sx)-@Value(Ex))*(@Value(Sy_t)-@Value(Ey_t))-(@Value(Sy)-@Value(Ey))*(@Value(Sx_t)-@Value(Ex_t)))*1.0))

 

Iy = @Evaluate(((@Value(Sx)*@Value(Ey)-@Value(Sy)*@Value(Ex))*(@Value(Sy_t)-@Value(Ey_t))-(@Value(Sy)-@Value(Ey))*(@Value(Sx_t)*@Value(Ey_t)-@Value(Sy_t)*@Value(Ex_t)))/(((@Value(Sx)-@Value(Ex))*(@Value(Sy_t)-@Value(Ey_t))-(@Value(Sy)-@Value(Ey))*(@Value(Sx_t)-@Value(Ex_t)))*1.0))

addendum:

test for parralell or nearly parralel lines to prevent calculation errors.

Like this

@Evaluate((@Value(Sx)-@Value(Ex))*(@Value(Sy_t)-@Value(Ey_t))-(@Value(Sy)-@Value(Ey))*(@Value(Sx_t)-@Value(Ex_t)) == 0)


Forum|alt.badge.img
  • Author
  • January 22, 2016

thanks all of you.. I choosed the easiest way (at least for me :)).. I choosed the answer of erik_jan but I di a filter to delete the start and the end vertices before doing the PointOnPointOverlayer.


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