[postgis-users] GeometryCollection

benton101 Ben.Davies at dec.wa.gov.au
Thu May 14 02:37:56 PDT 2009


Reply to self,

I applied ST_Dump, and it has returned a recored set that are all POLYGON's.
The thing I now have to work out is why I am missing 7000 records, as a
result of this.

Cheers
Ben

This is what I did with ST_Dump ... I dont know if it is right yet.

SELECT get_dump.species
     , get_dump.res_year
     , get_dump.area_m 
     , GeometryType((ST_Dump(get_dump.the_geom)).geom) AS the_geom
  FROM (SELECT get_union.species
             , get_union.res_year
             , get_union.area_m
             , ST_Intersection(get_buffer.the_geom,get_union.the_geom) AS
the_geom
          FROM (SELECT gid
                     , "NAME" as name
                     , ST_Buffer(the_geom, 200000) AS the_geom
                  FROM spl_mga_towns_pnt
                 WHERE "NAME" = 'CRANBROOK') AS get_buffer
             , (SELECT get_trans.gid
                     , INITCAP(get_trans.species) AS species
                     , get_trans.res_year
                     , ST_Area(ST_Buffer(get_trans.the_geom, 3, 10)) AS
area_m
                     , ST_Buffer(get_trans.the_geom, 3, 10) AS the_geom
                  FROM (SELECT a.gid
                             , b.name AS species
                             , c.res_year
                             , ST_Transform(a.the_geom, 28350) AS the_geom
                          FROM spl_geo_trees_lin a 
                             , aspl_species_lkup b
                             , aspl_resource_year_lkup c
                         WHERE a.spe_id = b.id
                           AND a.res_year = c.id) AS get_trans
                  UNION
                 SELECT gid
                      , "SPECIES" AS species
                      , "RES_YEAR" AS res_year
                      , ST_Area(the_geom) AS area_m
                      , ST_Transform(the_geom, 28350) AS the_geom
                   FROM spl_geo_trees_ply) AS get_union
       ) AS get_dump;

-- 
View this message in context: http://www.nabble.com/GeometryCollection-tp23536981p23537280.html
Sent from the PostGIS - User mailing list archive at Nabble.com.




More information about the postgis-users mailing list