[geos-devel] Envelope of empty Polygon

Mateusz Łoskot mateusz at loskot.net
Sun Apr 2 22:25:52 EDT 2006

Martin Davis wrote:
> JTS defines a concept of a null Envelope object state for precisely
> this reason.
> The reason for returning a null Envelope object rather than null is
> that in my experience most callers of getEnvelopeInternal want
> something they can test against.  If null was returned calling code
> would need a special check for every call.
> This is the same reason that empty Geometries are defined.  Often it
> simplifies code if there is something there, rather than null.

I understand it.
This rationale sounds good.

So, I'd cancel my agreement to return null pointer.
Martin's explanation is clear and I'd stick to operate on empty
Geometries rather than null pointers.
What do you think?

Mateusz Łoskot

More information about the geos-devel mailing list