[postgis-devel] xmin(geometry) behaviour

strk at refractions.net strk at refractions.net
Mon Mar 28 01:56:41 PST 2005


On Sun, Mar 27, 2005 at 11:16:27PM -0500, Carl Anderson wrote:
[ ... full quoting at end of mail ...]
> I believe the default should be to have more precision and reduced 
> precision should be explicit
> requests.  

What others think about this ?

SELECT min(xmin(geometry)) <-- should this do full geometries scan
			       yelding double precision result or
			       use cached bbox yelding single precision
			       result ?

In any case I'd avoid adding another function like xmin2d(), but
rather add {x,y,z}{min,max}(geometry).

Note that a dump/reload will be needed to upgrade from RC5 to next
release if we make this change.

--strk;

On Sun, Mar 27, 2005 at 11:16:27PM -0500, Carl Anderson wrote:
> strk at refractions.net wrote:
> 
> >On Sat, Mar 26, 2005 at 05:34:46PM -0500, Carl Anderson wrote:
> > 
> >
> >>possibly too late in the development cycle for this discussion.
> >>   
> >>
> >
> >Indeed.
> >
> >I was not trying to convince you.
> >I do see the problem, but I was giving you more information.
> >The solution you suggest is a non-solution as a box2d::box3d
> >cast doesn't give you more precision. The precision issue
> >is not related to output but internal representation:
> >
> >=# select xmin('POINT(1.0000000001 0)'::geometry::box3d);
> >1.0000000001
> >=# select xmin('POINT(1.0000000001 0)'::geometry::box3d::box2d);
> >   1
> >=# select xmin('POINT(1.0000000001 0)'::geometry::box3d::box2d::box3d);
> >   1
> >
> >The first call is the only one giving you full precision.
> >
> >The question here is if we really want to keep support for BOX3D
> >for other then just an input type support (implicitly casting
> >to box2d for any operation, for example).
> >
> >--strk;
> > 
> >
> 
> but the behavior demonstrated is the same in the present and my pondered 
> states
> (I pondered renaming xmin(box2d) to xmin2d(box2d), and leaving xmin(box3d) )
> passing through box2d will reduce precision, as a feature of the box2d 
> type no
> matter what the precision of the desination type will be.
> 
> xmin(box3d) uses   BOX3D_xmin
> xmin(box2d)  casts box2d into box3d and flows into BOX3D_xmin
> xmin(box3d::box2d::box3d) casts box3d into box2d casted into box3d and 
> flows into BOX3D_xmin
> 
> I believe the default should be to have more precision and reduced 
> precision should be explicit
> requests.  As you demonstrated you can't add precision after removing it.
> 
> I yield to your judgement, and thank you for your consideration.
> 
> C.
> 
> _______________________________________________
> 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