Hi, I am trying to split a single line at multiple locations based on values in a separate table. I also want to be able to start splitting from either end of the line. Any help will be greatly appreciated.
Page 1 / 1
Hi,
If you create points representing the split locations based on the table, you can apply the PointOnLineOverlayer (or other transformer having similar functionality) to split the line with the points.
The way of creating the points depends on the schema (attributes and their meanings) of features read from the table. If you explain about that, we could consider a concrete way.
Takashi
If you want to split the line based on distance or percentage, you can use a snipper for that.
Sort your splitlocations and put them in a list. Link this list to lline to split, create a index attribute (start at 0) and then send them to a snipper wich you put in a custom transformer.
Snipper values can be accessed by a listindexer.
By putting it in a customloop you can keep snipping on the remnants. (until index reaches total parts split) (hence the sorting..)
(there is a post somewhere in this forum on this technique)
Or you keep locations in table (add a column for start end location if needed) and duplicate (Cloner) item to be split as many times as splits, and then split them using locations. (there is a post somewhere in this forum on this technique too)
If the locations are points (or x,y). Then use neighbourfinder and insert vertex. Then PointOnAreaOverlayer (as Takashi suggested).
Hi Gio,
As you suggested, I am trying to use Snipper transformer. I created a list (using ListBuilder) and created index (using ListIndexer) but I am still confused as to what parameters to put for Starting Location and Ending Location in Snipper transformer.
Just to clarify on what I am trying to do. I have a sanitary polyline layer and a standalone table for Condition. Each line could have various conditions at specified distances resulting in 1:M relationship. I want to create a point layer for each condition. The additional challenge is that I have to split the line based on survey direction specified by upstream and downstream manholes.
Sorry if I am confusing you. I wish there was a way to share my workspace.
Thanks
See the transformer help to learn about the Snipper.
This is one possible way to create points. Assume that every record read from the table has ID of associated Line and the location of each condition is described by "distance" attribute of the record.
-----
Add a FeatureMerger to the workspace.
Send the record features to the Requestor port; send the Line features to the Supplier port.
Join On: Line ID to Line ID
Feature Merge Type: Geometry
The FeatureMerger with this setting merges a line geometry to records that have same line ID. If two or more records share same line ID, the Line will be copied for the records.
Then, connect a Snipper to the Merged port, and set the parameters like this:
Snipping Mode: Distance (Value).
Starting Location: distance
Ending Location: distance
The Snipper will output the required points.
Hi Takashi,
That worked !! However, I still need to figure out the snipping direction. I am assuming that snipping happens along digitized direction. But depending in the survey direction, I might have to "snip" in the reverse direction. Do you have any idea on how to specify snipping direction?
Thanks
Hi Takashi,
I was able to figure it out. I used Orientor transformer to flip the flow direction. Thank you and Gio for helping out.
Samir