Question

Line Splitting by Spatial Relation to Point Layer

  • 18 July 2013
  • 3 replies
  • 7 views

Hi, I'm trying to write attribute data that is stored in points to lines using a spatial join, but the issue is that the lines i'm attempting to join aren't broken up into enough or proper segements. The result is that the first point's data is asssigned to the line, when the line should ideally be three lines, each containing their own respective attributes.  

3 replies

Userlevel 3
Badge +26
The chopper transformer will chop the line down to a specified number of vertices. You can use the chopper with the parameter set to 2, in order to get individually straight lines.
Userlevel 2
Badge +17
Hi,   I suppose you are trying to split the lines at given points and merge attributes of a point which matches with the start node to each split line.  If my understanding is correct, one possible approach is: 1) Split lines at points (PointOnLineOverlayer). 2) Associate topologically split lines and points (TopologyBuilder). 3) Merge attributes of a point (start node) to each split line (FeatureMerger).   Although the PointOnLineOverlayer will transfer attributes of a point to spatially related line, the point is not always the start node of the line, so use the TopologyBuilder in order to be able to select exact start node. The TolologyBuilder will add _node_number to output nodes (points), and also add _from_node and _to_node to output lines. Since _from_node indicates _node_number of the start node, you can merge the attributes of the appropriate point (i.e. start node) to the line using _from_node and _node_number as keys.   Important i) The FeatureMerger doesn't overwrite attributes of the requestor (line) even if the supplier (point) has the same named attributes. So, line's attributes which were transfered from points by the PointOnLineOverlayer should be removed before using the FeatureMerger. Consider using an AttributeRemover or AttributeKeeper to do that. ii) If the original lines intersect each other, specify "Yes" to "Assume Clean Data" parameter of the TopologyBuilder, so that the lines will not be split at their intersections.   Takashi
Userlevel 2
Badge +17
... forgot to attach the image.

 

 

 

Reply