| 58 | {{{ |
| 59 | drop table if exists europe.wso; |
| 60 | CREATE TABLE europe.wso ( |
| 61 | id serial PRIMARY KEY, |
| 62 | wso_id integer, |
| 63 | area varchar(12) |
| 64 | ) |
| 65 | |
| 66 | insert into europe.wso(wso_id) |
| 67 | select distinct on (wso_id) wso_id from ccm21.riversegments r |
| 68 | join (SELECT ST_Union(f.the_geom) as singlegeom |
| 69 | FROM europe.limiteeurope As f where gid='11'or gid='2'or gid='27' ) as sub |
| 70 | ON ST_Intersects(sub.singlegeom,r.the_geom); --170828 lignes (avec st_contains 170703 lines) |
| 71 | |
| 72 | UPDATE europe.wso set area='France' where area IS NULL --693 sea nodes |
| 73 | |
| 74 | select * from ccm21.riversegments where wso_id in (select wso_id from europe.wso where area='France')--170703 lines |
| 75 | |
| 76 | CREATE INDEX europe_wso_id |
| 77 | ON france.wso |
| 78 | (wso_id); |
| 79 | }}} |