computeEnvelopeInternal method

Envelope computeEnvelopeInternal()
override

Returns the minimum and maximum x and y values in this Geometry , or a null Envelope if this Geometry is empty. Unlike getEnvelopeInternal, this method calculates the Envelope each time it is called; getEnvelopeInternal caches the result of this method.

@return this Geometrys bounding box; if the Geometry is empty, Envelope#isNull will return true

Implementation

Envelope computeEnvelopeInternal() {
  if (isEmpty()) {
    return new Envelope.empty();
  }
  Envelope env = new Envelope.empty();
  env.expandToInclude(coordinates!.getX(0), coordinates!.getY(0));
  return env;
}