[postgis-users] How cutting out polygon

Pavel Iacovlev iacovlev.pavel at gmail.com
Tue Sep 1 08:58:39 PDT 2009


You should translate the error message by the way if you want to get answers :)

I think the problem is that your select returns multiple
rows(geometries) but update expect 1 row. Try putting a
ST_COLLECT/ST_UNION in your query.

UPDATE fog_of_war
SET the_geom = (    SELECT
ST_Union(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));

2009/9/1 Daniel Grum <daniel.grum at unibw.de>:
> 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
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



-- 
http://iap.md, The future is open



More information about the postgis-users mailing list