55 | | --- Create table uga2010.id_drain with id_drain from BDCarthage for Bretagne |
56 | | drop table if exists uga2010.id_bdcarthage; |
57 | | CREATE TABLE uga2010.id_bdcarthage ( |
58 | | id serial PRIMARY KEY, |
59 | | id_bdcarth integer, |
60 | | uga varchar(25) |
61 | | ); |
62 | | |
63 | | --Bretagne |
64 | | insert into uga2010.id_bdcarthage(id_bdcarth) |
65 | | select distinct on (id_bdcarth) id_bdcarth from bd_carthage2011.troncon_hydrographique r |
66 | | join (SELECT ST_Union(f.the_geom) as singlegeom |
67 | | FROM uga2010.uga As f where libelle='Bretagne') as sub |
68 | | ON ST_Intersects(sub.singlegeom,r.the_geom); |
69 | | |
70 | | UPDATE uga2010.id_bdcarthage set uga='Bretagne' where uga IS NULL -- 27250 lignes |