[geos-devel] Envelope of empty Polygon

Mateusz Łoskot mateusz at loskot.net
Sun Apr 2 22:28:26 EDT 2006


strk at refractions.net wrote:
> On Fri, Mar 31, 2006 at 12:21:44PM +0200, strk at refractions.net wrote:
> 
>> Also, for Geometry, check out  getEnvelopeInternal().
>> That should return a pointer to internal cache, thus caller
>> wouldn't need to free the result.
>> JTS getEnvelope() is really what getEnvelopeInternal() is for
>> GEOS.
>> I'd drop the copying one and rename the *Internal() one.
> 
> ERRATA CORRIGE.
> 
> getEnvelopeInternal *is* a JTS method.
> It returns a cached Envelope.
> Always, never a NULL pointer
> (rather its NULL representation for EMPTY geoms).

Yes.

> Note that a NULL pointer, in this case
> is used to detect a not-yet-computed
> cache.

But null pointer should not cross API boundaries.
I mean, user is not required to check for null pointers regarding
Envelope, right?

Cheers
-- 
Mateusz Łoskot
http://mateusz.loskot.net



More information about the geos-devel mailing list