[postgis-users] Problem with st_translate

Bob Pawley rjpawley at shaw.ca
Wed Oct 21 10:01:07 PDT 2009


Hi

I have a table holding a number of rows of points which I want to translate from covering Box 1 to covering Box 2.

When I use the following all of the points are translated to the same central position (200 points stacked upon each other)

 insert into fluids (one)
 select st_translate(graphics.point_grid.the_geom,
 st_x(st_centroid(library.dgm_process.the_geom)) -
 st_x(st_centroid(graphics.point_grid.the_geom)),
 st_y(st_centroid(library.dgm_process.the_geom)) -
 st_y(st_centroid(graphics.point_grid.the_geom)))
 from  library.dgm_process, graphics.point_grid
 where library.dgm_process.process_number = '1'
 and graphics.point_grid.number = '1' ;
I've tried variations of the above without success.

When the same points are collected in a st_union operation occupying a single row the preceding works well.

I need these points in separate entities in order to select particular points, using the following -

insert into fluids (one)
 select st_translate(graphics.point_grid.the_geom,
 st_x(st_centroid(library.dgm_process.the_geom)) -
 st_x(st_centroid(graphics.point_grid.the_geom)),
 st_y(st_centroid(library.dgm_process.the_geom)) -
 st_y(st_centroid(graphics.point_grid.the_geom)))
 from  library.dgm_process, graphics.point_grid
 where library.dgm_process.process_number = '1'
 and graphics.point_grid.number = '1' 
 and st_within( graphics.point_grid.the_geom, st_box2d(library.dgm_process.the_geom)) = 't'
 and graphics.point_grid.the_geom <<| st_centroid(library.dgm_process.the_geom) ;

Is there some method of which I am unaware, for translating single points to a new location with the same relationship one to another??

Bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20091021/d14425e9/attachment.html>


More information about the postgis-users mailing list