[postgis-users] Re: two different geometries with the same Astext
Rhys Ickeringill
rhysi at omnilink.com.au
Tue Jul 19 21:52:50 PDT 2005
Just a thought - could this be a projection issue? As far as it can see, the
AsText version of a geometry does not include projection information. Could
it be that g1 and g2 are in different projections, but this fact is lost
when g1 and g2 are converted using AsText( )?
- Rhys
----- Original Message -----
From: "Miguel de la Fuente" <mjdelafuente at gmail.com>
To: <postgis-users at postgis.refractions.net>
Sent: Tuesday, July 19, 2005 11:35 PM
Subject: [postgis-users] Re: two different geometries with the same Astext
Thanks to everybory for your answers.
I'll try to make a better description of the problem an what I made
related to your answer.
To simplify the problem for you to analize it, I first extracted an
example from the source tables to a new table with a SELECT command:
select
a.the_geom as g1,
b.the_geom as g2
into pru
from p107_fm_co a, p107_mz_co b
where a.gid=618 and b.gid=2
and the I ran the following
select astext(g1),astext(g2),
within(geometryfromtext(astext(g1)),geometryfromtext(astext(g2)))as w1,
within(g1,g2) as w2
from pru
and I got
--"MULTILINESTRING((5256301.4 6014697.56,5256369.25
6014741.46))";"MULTILINESTRING((5256369.25 6014741.46,5256456.23
6014607.03,5256388.39 6014563.13,5256301.4 6014697.56,5256369.25
6014741.46))";t;f
as you could see the first within return TRUE and the second return
FALSE and that is what I can't understand
But, the worst thing of all is that when I made a backup of the table
to attach it this message I got this:
CREATE TABLE pru (g1 geometry, g2 geometry);
ALTER TABLE public.pru OWNER TO postgres;
INSERT INTO pru (g1, g2) VALUES
('0105000000010000000102000000020000009A9999591B0D54413D0AD763BAF15641000000
502C0D5441D7A3705DC5F15641',
'010500000001000000010200000005000000000000502C0D5441D7A3705DC5F15641EC51B80
E420D54411F85EBC1A3F156418FC2F518310D544185EB51C898F156419A9999591B0D54413D0
AD763BAF15641000000502C0D5441D7A3705DC5F15641');
I dropped the table made with the SELECT command described above and
re-created the table running this script.
And the I run:
select astext(g1),astext(g2),
within(geometryfromtext(astext(g1)),geometryfromtext(astext(g2)))as w1,
within(g1,g2) as w2
from pru
again and I got
--"MULTILINESTRING((5256301.4 6014697.56,5256369.25
6014741.46))";"MULTILINESTRING((5256369.25 6014741.46,5256456.23
6014607.03,5256388.39 6014563.13,5256301.4 6014697.56,5256369.25
6014741.46))";t;t
with both withins returning TRUE !!!!!
I'm really LOST!
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
More information about the postgis-users
mailing list