getEnvelope method

Envelope getEnvelope()

Computes the envelope of the edges in the subgraph. The envelope is cached after being computed.

@return the envelope of the graph.

Implementation

Envelope getEnvelope() {
  if (env == null) {
    Envelope edgeEnv = new Envelope.empty();
    for (DirectedEdge dirEdge in dirEdgeList) {
      List<Coordinate> pts = dirEdge.getEdge().getCoordinates();
      for (int i = 0; i < pts.length - 1; i++) {
        edgeEnv.expandToIncludeCoordinate(pts[i]);
      }
    }
    env = edgeEnv;
  }
  return env!;
}