[postgis-devel] BBOX caches: float or double ?

Paul Ramsey pramsey at opengeo.org
Wed Nov 9 09:39:38 PST 2011


Where in g_serialized.txt do you see the suggestion that the
serialized boxes are doubles? That is not the intent, so I am happy to
clarify: that doesn't happen. The serialization stores the boxes as
floats.

Now, when *deserialized* into LWGEOM->GBOX, they are held in doubles,
but that shouldn't be a problem, IMO.

P.

On Wed, Nov 9, 2011 at 6:58 AM, Sandro Santilli <strk at keybit.net> wrote:
> There seems to be some confusion about the BBOX cache format.
> The liblwgeom/g_serialized.txt seems to suggest that BBOX caches
> are using doubles, but code in liblwgeom/g_serialized.c use
> floats. Who's right and who's wrong ?
>
> Code using float:
>
> static size_t gserialized_from_gbox(const GBOX *gbox, uint8_t *buf)
>  // rounds to nearest float
>
> gserialized_read_gbox_p
>  // reads bbox as floats
>
> Note that gserialized_read_gbox_p is supposed to return a GBOX but
> given the confusion returns one based on doubles or on floats
> depending on availability of the cache.
>
> This is the reason for bug #1273, but can't imagine how many other
> such bugs are hiding...
>
> --strk;
>
>  ()   Free GIS & Flash consultant/developer
>  /\   http://strk.keybit.net/services.html
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>



More information about the postgis-devel mailing list