union method

Returns a MultiLineString that is the union of this MultiLineString and another MultiLineString. The resulting MultiLineString will have the same properties as this MultiLineString.

Example:

MultiLineString([[Coordinate(1, 2), Coordinate(3, 4)]]).union(MultiLineString([[Coordinate(4, 5), Coordinate(6, 7)]])); // MultiLineString([[Coordinate(1, 2), Coordinate(3, 4), Coordinate(4, 5), Coordinate(6, 7)]])

Implementation

MultiLineString union(MultiLineString other) {
  return MultiLineString([
    ...coordinates,
    ...other.coordinates,
  ], properties: properties);
}