Changes between Version 4 and Version 5 of CLC Join


Ignore:
Timestamp:
May 27, 2010 6:05:54 PM (15 years ago)
Author:
cedric
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CLC Join

    v4 v5  
    77CREATE TABLE clc.clipped_bretagne AS 
    88SELECT intersected.clcgid, intersected.gid, clipped_geom 
    9 FROM (SELECT clc.gid as clcgid, c.gid, ST_Intersection(clc.the_geom, c.the_geom) AS clipped_geom 
     9FROM (SELECT clc.gid as clcgid, c.gid, ST_Multi(ST_Intersection(clc.the_geom, c.the_geom)) AS clipped_geom 
    1010        FROM  clc.clc00_v2_europe clc INNER JOIN ccm21.catchments c 
    1111        ON  ST_Intersects (c.the_geom,clc.the_geom) 
    1212        WHERE c.wso_id IN (SELECT wso_id FROM france.wso WHERE area='Bretagne') 
    1313        AND substring(code_00 from 1 for 1)='1')  AS intersected;--3721 lines    
     14ALTER TABLE clc.clipped_bretagne add column id serial PRIMARY KEY; 
     15-- ajout dans la table geometry_columns pour référencement rapide sous Qgis 
     16INSERT INTO geometry_columns(f_table_catalog, f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, "type") 
     17SELECT '', 'clc', 'clipped_bretagne', 'the_geom', ST_CoordDim(clipped_geom), ST_SRID(clipped_geom), MULTIPOLYGON 
     18FROM clc.clipped_bretagne  LIMIT 1; 
    1419 
     20-- il ne s'affiche pas... essai réduit OK 
     21DROP TABLE IF EXISTS clc.clipped_bretagne; 
     22CREATE TABLE clc.clipped_bretagne AS 
     23SELECT clc.gid as clcgid,c.gid, clc.the_geom FROM clc.clc00_v2_europe clc INNER JOIN ccm21.catchments c 
     24        ON  ST_Intersects (c.the_geom,clc.the_geom) 
     25        WHERE c.wso_id IN (SELECT wso_id FROM france.wso WHERE area='Bretagne') 
     26        AND substring(code_00 from 1 for 1)='1'; 
    1527ALTER TABLE clc.clipped_bretagne add column id serial PRIMARY KEY; 
    1628 
    17 -- ajout dans la table geometry_columns pour référencement rapide sous Qgis 
    18  
    19 INSERT INTO geometry_columns(f_table_catalog, f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, "type") 
    20 SELECT '', 'clc', 'clipped_bretagne', 'the_geom', ST_CoordDim(clipped_geom), ST_SRID(clipped_geom), GeometryType(clipped_geom) 
    21 FROM clc.clipped_bretagne  LIMIT 1; 
    2229}}}