[postgis-devel] Why sometimes lwgeom_add_bbox and sometimes straight to lwgeom_compute_box2d

Nicklas Avén nicklas.aven at jordogskog.no
Sun Nov 28 10:41:04 PST 2010


Hallo

The enhancements of the code that you are doing Paul and Olivier makes
things much cleaner :-) Great!


Olivier, in changset #6180 in measures.c it seems like inconsistent use
lwgeom_add_bbox and lwgeom_compute_box2d.

http://trac.osgeo.org/postgis/changeset/6180/trunk/liblwgeom/measures.c

On line 265 and 269 you are using lwgeom_add_bbox and in line 393 and
395 you are going straight for lwgeom_compute_box2d.

Is there a reason or a mistake. 

I am trying to understand how I am supposed to handle this creation of
bbox since it causes a memory leak according to Valgrind. Should I just
free the bbox as soon as I don't use it or should the mechanism be to
free the whole geometry with the right free-function. If soo I have
understood the problem is to investigate if the geometry-pointer is
pointing to a copy or to the disk-version of the geometry, as Paul
explained in some post some time ago. Will there be changes in those
things or should I try to figure out how to handle it from what it looks
like today?

This, I think is quite complicated things so bear with me if the
questions makes no sense.

Thanks
Nicklas




More information about the postgis-devel mailing list