| 2 | |
| 3 | {{{ |
| 4 | -- Un essai sur la Bretagne pour voir |
| 5 | DROP TABLE IF EXISTS clc.clipped_bretagne; |
| 6 | CREATE TABLE clc.clipped_bretagne AS |
| 7 | SELECT intersected.clcgid, intersected.gid, clipped_geom |
| 8 | FROM (SELECT clc.gid as clcgid, c.gid, ST_Intersection(clc.the_geom, c.the_geom) AS clipped_geom |
| 9 | FROM clc.clc00_v2_europe clc INNER JOIN ccm21.catchments c |
| 10 | ON ST_Intersects (c.the_geom,clc.the_geom) |
| 11 | WHERE c.wso_id IN (SELECT wso_id FROM france.wso WHERE area='Bretagne') |
| 12 | AND substring(code_00 from 1 for 1)='1') AS intersected;--3721 lines |
| 13 | ALTER TABLE clc.clipped_bretagne add column id serial PRIMARY KEY; |
| 14 | -- ajout dans la table geometry_columns pour référencement rapide sous Qgis |
| 15 | INSERT INTO geometry_columns(f_table_catalog, f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, "type") |
| 16 | SELECT '', 'clc', 'clipped_bretagne', 'the_geom', ST_CoordDim(clipped_geom), ST_SRID(clipped_geom), GeometryType(clipped_geom) |
| 17 | FROM clc.clipped_bretagne LIMIT 1; |
| 18 | }}} |