wiki:Cookbook CCM21_EcologicalRegion

Version 7 (modified by celine, 14 years ago) (diff)

--

back to first page ..
back to CookBook Eda
back to UGA
back to Ecological regions

drop table  if exists ecoregion2003.wso1;
     CREATE TABLE ecoregion2003.wso1 (
     id serial PRIMARY KEY,
     wso_id integer,
     wso1_id integer,
     ecoregion varchar(99)
     );

||Southern Temperate Atlantic||11||
||Western European broadleaf forests||55||
||Northeastern Spain & Southern France Mediterranean||162||
||Cantabrian mixed forests||14||

 --Southern Temperate Atlantic
    insert into ecoregion2003.wso1(wso_id, wso1_id) 
    select distinct on (wso1_id, wso_id) wso_id, wso1_id from ccm21.riversegments r
    join (SELECT ST_Union(f.the_geom) as singlegeom
        FROM ecoregion2003.ecologicalregion_polygon As f where eco_code='11') as sub
    ON ST_Intersects(sub.singlegeom,r.the_geom);

    UPDATE ecoregion2003.wso1 set ecoregion='Southern Temperate Atlantic' where ecoregion IS NULL -- lignes