[postgis-users] How cutting out polygon

Daniel Grum daniel.grum at unibw.de
Tue Sep 1 08:29:54 PDT 2009


Hi.

How I can cut 4 or more differnt polygon geometries out of one big 
geomtry[MULTIPOLYGON].

I have one polygon (saved in the schema.tabel.column:  
public.fog_of_war.the_geom)
and from this I want to cut out  the squares, that I create with:

SELECT 
ST_Intersection(grenze_by.the_geom,ST_Expand(holzfaeller.the_geom, 5000))
FROM public.grenze_by grenze_by, public.holzfaeller holzfaeller 
WHERE grenze_by.the_geom && ST_Expand(holzfaeller.the_geom, 5000));

I don't want to save this cut out information in an extra table, I only 
want to get a fog_of_war layer.
And You only can see what is behind this Layer(than you see the map and 
bulidings) where the layer was cut out.

Can I solve this problem with UPDATE like this:

UPDATE fog_of_war
SET the_geom = (    SELECT 
ST_Intersection(grenze_by.the_geom,ST_Expand(holzfaeller.the_geom, 5000))
                                FROM public.grenze_by grenze_by, 
public.holzfaeller holzfaeller 
                                WHERE grenze_by.the_geom && 
ST_Expand(holzfaeller.the_geom, 5000));

I ask because I get the message: "FEHLER:  als Ausdruck verwendete 
Unteranfrage ergab mehr als eine Zeile"

Thanks in advance.

--Daniel



More information about the postgis-users mailing list