[postgis-devel] alignment issues
strk at refractions.net
strk at refractions.net
Thu Feb 10 08:33:28 PST 2005
On Thu, Feb 10, 2005 at 03:56:22PM -0000, Mark Cave-Ayland wrote:
> Hi strk,
>
> > -----Original Message-----
> > From: postgis-devel-bounces at postgis.refractions.net
> > [mailto:postgis-devel-bounces at postgis.refractions.net] On
> > Behalf Of strk at refractions.net
> > Sent: 10 February 2005 14:13
> > To: 'PostGIS Development Discussion'
> > Subject: Re: [postgis-devel] alignment issues
>
> (cut)
>
> > > I haven't had much experience with alignment issues, however this
> > > looks like the easiest solution to me (e.g. you can declare
> > a single
> > > POINT2D in your function and then reuse it for the entire set of
> > > POINT2Ds referenced within). I also noticed in the source that the
> > > functions to do this already exist, for example getPoint2d_p....
> >
> > Yes, but they are cheating, they call getPoint() internally
> > ... --strk;
>
> Really? Looking at RC2 I can't see any reference to getPoint() in
> getPoint2d_p(), plus the code looks fairly similar to getPoint() just below
> it...? Is this done in pointArray_ptsize() or in the serialized_pointlist[]
> array?
That one doesn't, getPoint3dz_p and others do.. not much important,
I've already fixed them to not use casts. Also, I've renamed getPoint() to
getPoint_internal(), as it would still be useful to get a reference to
byte offset of a given point inside a POINTARRAY (tipically for setting
value of a specific point).
BTW, POINTARRAY management is not our only alignment-related issue.
We also have LWGEOM->bbox being a casted pointer to internal (serialized)
storage - easily fixed - and most notably the SERIALIZED_FORM() macro
which just moves the pointer 4 bytes after the start...
These are big changes, but I think its worth completing before 1.0.
--strk;
>
>
> Kind regards,
>
> Mark.
>
> ------------------------
> WebBased Ltd
> South West Technology Centre
> Tamar Science Park
> Plymouth
> PL6 8BT
>
> T: +44 (0)1752 791021
> F: +44 (0)1752 791023
> W: http://www.webbased.co.uk
>
>
> _______________________________________________
> 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