Thanks Johannes
That worked very well.
Bob
----- Original Message -----
From: "Johannes Sommer" <[email protected]>
To: "PostGIS Users Discussion" <[email protected]>;
<[email protected]>
Sent: Saturday, July 25, 2009 12:14 PM
Subject: Re: [postgis-users] Two geometries same column
Hi Bob,
you can put alias names to the same column and use them in your statement:
select a.geometry, b.geometry from sometable a, sometable b
so in your case it would be something like:
update p_id.image
set one =
(select st_makeline(st_centroid(a.the_geom), st_centroid(b.the_geom))
from p_id.image a, p_id.image b
where (a.fluid_id = '1513'
and a.description = 'A')
and (b.fluid_id = '1513'
and b.description = 'B'))
bye,
Johannes
Bob Pawley schrieb:
Hi
I ahve two geometries say A and B in the same column.
I want to make a line between geometry A and geometry B.
How can I write the expression so that Postgresql recognizes that A
and B are in separate rows?
I have tried the following which produces a null return.
update a --p_id.image
set one = --the_geom =
(select
st_makeline(st_makepoint(st_x(st_centroid(p_id.image.the_geom)),
st_y(st_centroid(p_id.image.the_geom))),
st_centroid(p_id.image.the_geom))
from p_id.image
where (p_id.image.fluid_id = '1513'
and p_id.image.description = 'A')
and (p_id.image.fluid_id = '1513'
and p_id.image.description = 'B'))
Bob
------------------------------------------------------------------------
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users