[postgis-users] Re: two different geometries with the same Astext
Miguel de la Fuente
mjdelafuente at gmail.com
Mon Jul 25 11:35:59 PDT 2005
On 7/23/05, strk at refractions.net <strk at refractions.net> wrote:
> Miguel, if the summirized test still holds:
>
> > > 1) within: false
> > > 2) within(dropbbox): true
> > > 3) within(addbbox(dropbbox)): true
>
> I'd like to have some confirmation of the fact that
> the boxes in 1) and 3) differ.
>
> Try something like:
>
> select box2d(dropbbox(g2))::geometry::text = box2d(g2)::geometry::text;
This returns false
> select box2d(dropbbox(g1))::geometry::text = box2d(g1)::geometry::text;
and this returns true
>
> I'd expect one (or both) these to return FALSE.
>
> --strk;
>
I ran this:
select astext(g1), box2d(g1), box2d(dropbbox(g1)),
astext(g2), box2d(g2), box2d(dropbbox(g2))
from table1
And select by hand the minimum and maximum from the astext() result
for comparing and get
(5256301.4 6014697.56, 5256369.25 6014741.46) g1
(5256301 6014697.5 , 5256369.5 6014741.5 ) box2d(g1)
(5256301 6014697.5 , 5256369.5 6014741.5 ) box2d(dropbbox(g1))
(5256301.4 6014563.13, 5256456.23 6014741.46) g2
(5256301.5 6014563 , 5256456 6014741.5 ) box2d(g2)
(5256301 6014563 , 5256456.5 6014741.5 ) box2d(dropbbox(g2))
As you see the box2d is rounding, and box2d(g1) is not inside box2d(g2).
I can't understand why.
More information about the postgis-users
mailing list