Some ideas: Rule 1: If the end of line A touches line B then break line b at that point
Create end nodes of line A (CoordinateExtractor + 2DPointReplacer), split line B at those points (PointOnLineOverlayer).
Rule 2: If line A has a node/joint on it, break it at that point
If node/joint are given as points, send the node/joint to POINT, line A to LINE port of a PointOnLineOverlayer.
Rule 3: If line A crosses line B, but there is NOT a vertices at the point it crosses, DO NOT break that line
Create all vertices of A and B (Chopper: Mode = By Vertex, Maximum Vertices = 1), select common vertices (Matcher), and then split A and B at the common vertices (PointOnLineOverlayer). If a line has self-intersections at its own vertices, filter out duplicate vertices of the same line before selecting common vertices.
Rule 4: if line A crosses line B, but the end of line B is a short distance away from line A, shorten the line to A, and break.
Maybe "Find intersecting lines that have different attribute values" could be applied to find intersections between A and B. To find the closest points on line A from end nodes of line B, the NeighborFinder can be used after creating end nodes of line B.
Rule 5: IF line B does not quite touch line A, adjust its length and break
A SpatialFilter (Tests to Perform = DISJOINT) can be used to find line B which does not touch line A. I couldn't understand the rule of adjusting length and breaking...
Takashi
P.S. (Rule 5) If there are multiple A and you use the SpatialFilter with DISJOINT to find B (CANDIDATE) which doesn't touch any A (BASE), specify "Pass Against All Bases" to "Pass Criteria" parameter.
Thanks for the help Takashi, got me well on my way!
I think you can do this with 2 topology builders and some snappers.
I would.
- use a endpoint snapper followed by a segment snapper. (set to a small max value).
- (concerning " If line A crosses line B, but there is NOT a vertices at the point it crosses, DO NOT break that line"
Identify those crossings by lineonlineoverlayer and cut a piece out (either from B or A, not both). ID them as something like "bridge".
Create topology, network=not clean. But do not use the cut outs (yet).
- check if network is fully connected (apart from "bridges" of course)
- if satisfied, use another topology builder. Only this time set it to network = clean. This will prevent "bridges" to be cut, so no node will be created there.
If snapping to small value still leaves some unconnected or still overshot, snap those again with a larger setting.
(this is about a standard technique I mostly use)