Taking the union()
of polylines doesn't connect them together, but places
them in the same arrangement (it might even break them up depending on their
monotonicity). connect_polylines()
does exactly what it advertises. it
takes a vector of polylines (or a list of polyline vectors) and combines them
into a single polyline by connecting the endpoint of each polyline with the
start point of the next. If the end and the start are equal the duplicate
vertex will be removed.