[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    [postgis-users] Build a fog of war with ST_BuildArea(),
From:       Daniel Grum <daniel.grum () unibw ! de>
Date:       2009-11-30 14:29:52
Message-ID: 4B13D6E0.1040901 () unibw ! de
[Download RAW message or body]

Hi,

I want to create an fog of war. I use a start-polygon and in this should 
be the area screened transparent where the user has build some buildings.

Here is the SQL-script that works if the user has a building of every 
building-type but if he only has an "haupthaus" no geom will be 
created???!!!

But at the beginning the user only has the building: haupthaus-->and for 
this starting situation a fog of war has to be created.

UPDATE fog_of_war2
SET the_geom = (SELECT ST_BuildArea(
            St_Collect(grenze_by.the_geom,
                ST_Union(        ST_Union(    
ST_Union(ST_Union(ST_Expand(holzfaeller.the_geom, 
2000)),ST_Union(ST_Expand(steinbruch.the_geom,2000))),
                                    
ST_Union(ST_Union(ST_Expand(erzmine.the_geom, 
2000)),ST_Union(ST_Expand(kaserne.the_geom,2000)))),
                            ST_Union(    
ST_Union(ST_Union(ST_Expand(wohnhaus.the_geom, 
2000)),ST_Union(ST_Expand(saegewerk.the_geom,2000))),
                                    
ST_Union(ST_Union(ST_Expand(strassen.the_geom, 
1000)),ST_Union(ST_Expand(haupthaus.the_geom,6000)))))))
        FROM     public.grenze_by grenze_by,
            public.holzfaeller2 holzfaeller,
            public.steinbruch2 steinbruch,
            public.erzmine2 erzmine,
            public.kaserne2 kaserne,
            public.wohnhaus2 wohnhaus,
            public.saegewerk2 saegewerk,
            public.strassen2 strassen,
            public.haupthaus2 haupthaus
        GROUP BY grenze_by.the_geom);

I know that the functions are very convoluted, but for me there is no 
other way to union/collect the different areas of the buildings.

Please give me some tips how I can solve the problem.

--daniel
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic