back to first page [..][[BR]] back to ["CookBook Eda"][[BR]] back to ["Limites administratives Europe"][[BR]] Pour la France mettre : France (gid=11)+Andorre (gid=2) +Monaco (gid=27) ?[[BR]] {{{ create schema europe; drop table if exists europe.wso; CREATE TABLE europe.wso ( id serial PRIMARY KEY, wso_id integer, area varchar(12) ); ----France insert into europe.wso(wso_id) select distinct on (wso_id) wso_id from ccm21.riversegments r join (SELECT ST_Union(f.the_geom) as singlegeom FROM europe.limiteeurope As f where gid='11'or gid='2'or gid='27' ) as sub ON ST_Intersects(sub.singlegeom,r.the_geom); UPDATE europe.wso set area='France' where area IS NULL; --680 sea nodes select * from ccm21.riversegments where wso_id in (select wso_id from europe.wso where area='France');--170734 lines (with france.departement 170703 lines) ----Germany insert into europe.wso(wso_id) select distinct on (wso_id) wso_id from ccm21.riversegments r join (SELECT ST_Union(f.the_geom) as singlegeom FROM europe.limiteeurope As f where gid='12') as sub ON ST_Intersects(sub.singlegeom,r.the_geom); UPDATE europe.wso set area='Germany' where area IS NULL; ----Spain (+Gibraltar) insert into europe.wso(wso_id) select distinct on (wso_id) wso_id from ccm21.riversegments r join (SELECT ST_Union(f.the_geom) as singlegeom FROM europe.limiteeurope As f where gid='37' or gid='13') as sub ON ST_Intersects(sub.singlegeom,r.the_geom); UPDATE europe.wso set area='Spain' where area IS NULL; ----Italy (+San Marino) insert into europe.wso(wso_id) select distinct on (wso_id) wso_id from ccm21.riversegments r join (SELECT ST_Union(f.the_geom) as singlegeom FROM europe.limiteeurope As f where gid='19' or gid='33') as sub ON ST_Intersects(sub.singlegeom,r.the_geom); UPDATE europe.wso set area='Italy' where area IS NULL; ----Ireland insert into europe.wso(wso_id) select distinct on (wso_id) wso_id from ccm21.riversegments r join (SELECT ST_Union(f.the_geom) as singlegeom FROM europe.limiteeurope As f where gid='17') as sub ON ST_Intersects(sub.singlegeom,r.the_geom); UPDATE europe.wso set area='Ireland' where area IS NULL; ----Sweden insert into europe.wso(wso_id) select distinct on (wso_id) wso_id from ccm21.riversegments r join (SELECT ST_Union(f.the_geom) as singlegeom FROM europe.limiteeurope As f where gid='38') as sub ON ST_Intersects(sub.singlegeom,r.the_geom); UPDATE europe.wso set area='Sweden' where area IS NULL; ----UK insert into europe.wso(wso_id) select distinct on (wso_id) wso_id from ccm21.riversegments r join (SELECT ST_Union(f.the_geom) as singlegeom FROM europe.limiteeurope As f where gid='40') as sub ON ST_Intersects(sub.singlegeom,r.the_geom); UPDATE europe.wso set area='UK' where area IS NULL; ---- Ajout des UGA insert into europe.wso (wso_id,area) select wso_id,uga from uga2010.wso CREATE INDEX europe_wso_id ON europe.wso (wso_id); }}} {{{ ---Spain-Atl insert into europe.wso(wso_id) (select wso_id from europe.wso where area='Spain' except (select wso_id from europe.wso where area='France')) intersect (select wso_id from ccm21.seaoutlets where area_cd='A1'); UPDATE europe.wso set area='Spain_Atl' where area IS NULL; --WRB Western River Basin insert into europe.wso(wso_id) select distinct on (wso_id) wso_id from ccm21.riversegments r join (SELECT the_geom FROM european_wise2008.rbd_f1v3 As f where gid=39) as sub ON ST_Intersects(sub.the_geom,r.the_geom); UPDATE europe.wso set area='Western' where area IS NULL; --Anglian insert into europe.wso(wso_id) select distinct on (wso_id) wso_id from ccm21.riversegments r join (SELECT the_geom FROM european_wise2008.rbd_f1v3 As f where gid=200) as sub ON ST_Intersects(sub.the_geom,r.the_geom); UPDATE europe.wso set area='Anglian' where area IS NULL; --Sardinia insert into europe.wso(wso_id) select distinct on (wso_id) wso_id from ccm21.riversegments r join (SELECT the_geom FROM european_wise2008.rbd_f1v3 As f where gid=85) as sub ON ST_Intersects(sub.the_geom,r.the_geom); UPDATE europe.wso set area='Sardinia' where area IS NULL; --Swedish ? insert into europe.wso(wso_id) select distinct on (wso_id) wso_id from ccm21.riversegments r join (SELECT the_geom FROM european_wise2008.rbd_f1v3 As f where gid=85) as sub ON ST_Intersects(sub.the_geom,r.the_geom); UPDATE europe.wso set area='Swedish' where area IS NULL; --Elbe ? insert into europe.wso(wso_id) select distinct on (wso_id) wso_id from ccm21.riversegments r join (SELECT the_geom FROM european_wise2008.rbd_f1v3 As f where gid=208) as sub ON ST_Intersects(sub.the_geom,r.the_geom); UPDATE europe.wso set area='Elbe' where area IS NULL; }}} {{{ ---Sauvegarde des données D: cd D:\CelineJouanin\backup C:\"Program Files"\PostgreSQL\8.4\bin\pg_dump -U postgres -p 5433 -t geobs2010.obstacle_referenciel_projccm eda2.0> geobs2010.obstacle_referenciel_projccm.sql }}}