getEnvelope method

Geometry getEnvelope()

Gets a Geometry representing the envelope (bounding box) of this Geometry.

If this Geometry is:

  • empty, returns an empty Point.
  • a point, returns a Point.
  • a line parallel to an axis, a two-vertex LineString
  • otherwise, returns a Polygon whose vertices are (minx miny, maxx miny, maxx maxy, minx maxy, minx miny).

@return a Geometry representing the envelope of this Geometry

@see GeometryFactory#toGeometry(Envelope)

Implementation

Geometry getEnvelope() {
  return getFactory().toGeometry(getEnvelopeInternal());
}