This command converts any collection of line segments into a linear
network by guessing the connectivity of the network,
using the distance threshold eps
.
If any segments in X
cross over each other, they are first
cut into pieces using selfcut.psp
.
Then any pair of segment endpoints lying closer than eps
units apart, is treated as a single vertex. The linear network
is then constructed using linnet
.
It would be wise to check the result by plotting the degree
of each vertex, as shown in the Examples.
If X
has marks, then these are stored in
the resulting linear network Y <- as.linnet(X)
,
and can be extracted as marks(as.psp(Y))
or marks(Y$lines)
.