Skip to main content

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

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

Disregard the Intersected lines output port.


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..


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:


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 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.


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)


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.


Reply