[postgis-users] Creating a Flow Diagram
Bob Pawley
rjpawley at shaw.ca
Sun Jun 8 14:14:07 PDT 2008
I 'm playing with a variation of the st_translate function we were
discussing last week.
I have created two boxes (spatial_ref) and I wish to place an entity
(graphics.process_dgm) into the temp_ table with the coordinates that
centers the entity in a specific one of these boxes.
Here's the code that I have come up with but so far it produces 0 rows.
Insert into temp_ (the_geom)
Select st_translate(st_translate (graphics.process_dgm.the_geom,
st_y (st_centroid(graphics.process_dgm.the_geom)) - st_x (st_centroid
(spatial_ref.the_geom)),
st_y (st_centroid(graphics.process_dgm.the_geom)) - st_y (st_centroid
(spatial_ref.the_geom))),
( st_xmax(graphics.process_dgm.the_geom) -
st_xmin(graphics.process_dgm.the_geom)),
( st_ymax(graphics.process_dgm.the_geom) -
st_ymin(graphics.process_dgm.the_geom)))
from graphics.process_dgm, spatial_ref, temp_
where graphics.process_dgm.description = 'Tank'
and spatial_ref.position_ = '2';
Thoughts will be appreciated.
Bob
More information about the postgis-users
mailing list