Changes between Version 14 and Version 15 of Cookbook CCM21_France


Ignore:
Timestamp:
May 31, 2010 1:22:46 PM (15 years ago)
Author:
cedric
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Cookbook CCM21_France

    v14 v15  
    6565select * from ccm21.riversegments where wso_id in (select wso_id from france.wso where area='Bretagne')--2115 lines 
    6666}}} 
     67 
     68Creating local tables for Britany (to enhance speed and allow fast testing and displaying in Qgis 
     69{{{ 
     70-- I'm adding some original data tables restricted for an area for Qgis easy use 
     71-- extraction of a clc table for Britany 
     72DROP TABLE IF EXISTS clc.clc00_v2_Bretagne; 
     73CREATE TABLE clc.clc00_v2_Bretagne AS 
     74SELECT * FROM clc.clc00_v2_europe where gid IN ( 
     75SELECT gid FROM  clc.clc00_v2_europe clc JOIN 
     76    (SELECT the_geom FROM france.region where code_reg='53') as sub 
     77    ON ST_Contains(sub.the_geom,clc.the_geom)); 
     78ALTER TABLE clc.clc00_v2_Bretagne ADD CONSTRAINT c_pk_gid PRIMARY KEY  (gid); 
     79INSERT INTO geometry_columns(f_table_catalog, f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, "type") 
     80SELECT '', 'clc', 'clc00_v2_Bretagne', 'the_geom', ST_CoordDim(the_geom), ST_SRID(the_geom), GeometryType(the_geom) 
     81FROM clc.clc00_v2_europe LIMIT 1; 
     82 
     83-- Creating a table for riversegments Bretagne 
     84 
     85DROP TABLE IF EXISTS ccm21.riversegments_Bretagne;    
     86CREATE TABLE  ccm21.riversegments_Bretagne AS 
     87    SELECT * FROM ccm21.riversegments 
     88        WHERE wso_id IN (SELECT wso_id FROM france.wso WHERE area='Bretagne'); 
     89ALTER TABLE ccm21.riversegments_Bretagne ADD CONSTRAINT c_pk_gid_riversegments_Bretagne PRIMARY KEY  (gid); 
     90INSERT INTO geometry_columns(f_table_catalog, f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, "type") 
     91SELECT '', 'ccm21', 'riversegments_Bretagne', 'the_geom', ST_CoordDim(the_geom), ST_SRID(the_geom), GeometryType(the_geom) 
     92FROM ccm21.riversegments_Bretagne LIMIT 1; 
     93 
     94-- creating a table for catchments Bretagne. 
     95DROP TABLE IF EXISTS ccm21.catchments_Bretagne;    
     96CREATE TABLE  ccm21.catchments_Bretagne AS 
     97    SELECT * FROM ccm21.catchments 
     98        WHERE wso_id IN (SELECT wso_id FROM france.wso WHERE area='Bretagne');   
     99ALTER TABLE ccm21.catchments_Bretagne ADD CONSTRAINT c_pk_gid_catchments_Bretagne PRIMARY KEY  (gid); 
     100INSERT INTO geometry_columns(f_table_catalog, f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, "type") 
     101SELECT '', 'ccm21', 'catchments_Bretagne', 'the_geom', ST_CoordDim(the_geom), ST_SRID(the_geom), GeometryType(the_geom) 
     102FROM ccm21.catchments_Bretagne LIMIT 1; 
     103}}}