3

As you know GeoTools uses OpenGIS declared APIs; BoundingBox and Envelope for example.

Envelope

picture from geotools docs.

BoundingBox

Represents a two-dimensional envelope. This interface combines the ideas of GeographicBoundingBox with those of Envelope. It provides convenience methods to assist in accessing the formal properties of this object. Those methods (for example getMinX()) match common usage in existing libraries like Java2D.

Envelope

A minimum bounding box or rectangle. Regardless of dimension, an Envelope can be represented without ambiguity as two direct positions (coordinate points). To encode an Envelope. it is sufficient to encode these two points. This is consistent with all of the data types in this specification, their state is represented by their publicly accessible attributes.

I read the docs. Both of them describe a bounding region, but what is the difference?And what need to declare both? Where do you use them?

1 Answer 1

5

The main difference is that a bounding box is 2 dimensional while an envelope has 2 or more dimensions. A dimension is a "direction" so for a bounding box there are 2 (North and East or X and Y) while for an envelope there can be lots like North, East, Up, or X, Y and time, or X,Y,Z,T.

3
  • at least in PostGIS there as a box3d ... Commented Oct 11, 2015 at 13:27
  • Can you help me to understand better what you wrote? I didn't pick up what dimension means exactly. - @iant Commented May 19, 2017 at 2:22
  • @DiogoCaribé it is only 5 years later but i figured the comment is helpful nonetheless. a bounding box is used for 2 dimensional data (x, y) points. Whereas you might have some data that contains a 3rd dimension (x, y, z) such as elevation data. as i understand it, an envelope is a n-dimensional version of a bounding box
    – thus__
    Commented Jan 8, 2023 at 23:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.