[postgis-users] Insert using rule

Nahum Castro pedro1_72 at yahoo.com
Wed May 21 07:10:52 PDT 2014


Hello all
I try to insert the result of an interssection in another table using rules like this.

CREATE RULE interseccion_con_anp AS ON INSERT TO z0_poligono_corte 
   DO also insert into z0_a_n_p_13 (id_poligono, folio, obs, anp, geometria) select pol.id, pol.folio, pol.obs, capa.anp, ST_Multi(ST_Intersection(capa.geom, pol.geometria))
from a_n_p_13 capa, z0_poligono_corte pol
where pol.id=NEW.id
and capa.geom && pol.geometria
and ST_IsEmpty(ST_Intersection(capa.geom, pol.geometria)) != TRUE;

When I save a poligon on z0_poligono_corte, use that polygon to intersect with polygons on layer a_n_p_13 capa and save the result on  z0_a_n_p_13 but don't work and there are not errors on postgresql.log.

Thanks

 
--
Nahum Castro
Leon, Guanajuato, Mexico
http://www.leon-linux.com
e-mail: pedro1_72 [en] yahoo [punto] com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20140521/88535f19/attachment.html>


More information about the postgis-users mailing list