Bob,
 
If you want to skip over linestrings in your update, you should move that
condition out of your correlated sub query.  The way you had it, since its a
subselect and valu is setting the ip_target it has to be run for all
records.
 
so change to 
 
Something like
 
UPDATE temp_arrow
 set ip_target  = 
 (  select (st_translate(graphics.utilities_dgm.the_geom, 
 st_x (st_startpoint(temp_arrow.ithe_geom))-
 st_x (st_startpoint(graphics.utilities_dgm.the_geom)) ,
 st_y (st_centroid(temp_arrow.ithe_geom))-
 st_y (st_startpoint(graphics.utilities_dgm.the_geom)))) 
  from graphics.utilities_dgm, temp_arrow, p_id.p_id, p_id.processes
  where temp_arrow.graphic_id = p_id.p_id.process_graphic_id
  and p_id.p_id.process_id = p_id.processes.process_id
  and p_id.processes.fluid_id = temp_arrow.fluid_id
   and graphics.utilities_dgm.utilities_description = 'Arrow_Flow_Direction'

  and graphics.utilities_dgm.orientation = p_id.p_id.ip_orient ) 
 
WHERE ST_GeometryType(temp_arrow.ithe_geom) = 'ST_MultiLineString'  
 
Leo
 

  _____  

From: [email protected]
[mailto:[email protected]] On Behalf Of Bob
Pawley
Sent: Tuesday, June 09, 2009 4:27 PM
To: PostGIS Users Discussion
Subject: [postgis-users] Empty Geometry


In the past, when the update conditions are not met, the update transaction
doesn.t finalize.
 
However when I run the following update function where
ST_GeometryType(temp_arrow.ithe_geom) = 'ST_MultiLineString'  is not true,
then the return is a null value.
 
Is there a workaround to this problem??
 
 update temp_arrow
 set ip_target  = 
 (  select (st_translate(graphics.utilities_dgm.the_geom, 
 st_x (st_startpoint(temp_arrow.ithe_geom))-
 st_x (st_startpoint(graphics.utilities_dgm.the_geom)) ,
 st_y (st_centroid(temp_arrow.ithe_geom))-
 st_y (st_startpoint(graphics.utilities_dgm.the_geom)))) 
  from graphics.utilities_dgm, temp_arrow, p_id.p_id, p_id.processes
  where temp_arrow.graphic_id = p_id.p_id.process_graphic_id
  and p_id.p_id.process_id = p_id.processes.process_id
  and p_id.processes.fluid_id = temp_arrow.fluid_id
  and ST_GeometryType(temp_arrow.ithe_geom) = 'ST_MultiLineString'  
  and graphics.utilities_dgm.utilities_description = 'Arrow_Flow_Direction' 
  and graphics.utilities_dgm.orientation = p_id.p_id.ip_orient );
 
 
Bob
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to