boundaryLineString method

Geometry? boundaryLineString(
  1. LineString line
)

Implementation

Geometry? boundaryLineString(LineString line) {
  if (geom.isEmpty()) {
    return getEmptyMultiPoint();
  }

  if (line.isClosed()) {
    // check whether endpoints of valence 2 are on the boundary or not
    bool closedEndpointOnBoundary = bnRule.isInBoundary(2);
    if (closedEndpointOnBoundary) {
      return line.getStartPoint();
    } else {
      return geomFact.createMultiPointEmpty();
    }
  }
  return geomFact
      .createMultiPoint([line.getStartPoint()!, line.getEndPoint()!]);
}