Changes between Version 10 and Version 11 of Meuse dbeel


Ignore:
Timestamp:
Jun 5, 2014 10:20:11 AM (11 years ago)
Author:
cedric
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Meuse dbeel

    v10 v11  
    561561------------------------------------------------------------------------------------ 
    562562-- selection des opérations de l'ensemble des données de dbeel: 
    563 DROP TABLE IF EXISTS dbeel.operations_ccm_500; 
    564 CREATE TABLE dbeel.operations_ccm_500 as ( 
    565         SELECT distinct on (op_id) op_id, gid, wso1_id, min(distance) as distance, the_geom FROM ( 
    566                SELECT op_id, gid , wso1_id, CAST(distance(r.the_geom, s.the_geom) as  decimal(15,1)) as distance,s.the_geom  
     563DROP TABLE IF EXISTS dbeel.observation_places_ccm_500; 
     564CREATE TABLE dbeel.observation_places_ccm_500 as ( 
     565        SELECT distinct on (op_id) op_id, gid, wso1_id, min(distance) as distance,op_gis_layername, the_geom FROM ( 
     566               SELECT op_id, gid , wso1_id,op_gis_layername, CAST(distance(r.the_geom, s.the_geom) as  decimal(15,1)) as distance,s.the_geom  
    567567               FROM dbeel.observation_places As s 
    568568               INNER JOIN  ccm21.riversegments r ON ST_DWithin(r.the_geom, s.the_geom,500)  --76406 observations sur 92286 
    569569               WHERE s.the_geom IS NOT NULL 
    570570               ) AS sub  
    571         GROUP BY op_id,distance, gid, wso1_id,  the_geom 
     571        GROUP BY op_id,distance, gid, wso1_id,  the_geom,op_gis_layername 
    572572); 
    573573 
    574 alter table dbeel.operations_ccm_500 add column id serial; 
     574alter table dbeel.observation_places_ccm_500 add column id serial; 
    575575 
    576576-- mise à jour de la table geometry_columns 
    577577INSERT INTO geometry_columns(f_table_catalog, f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, "type") 
    578 SELECT '', 'dbeel', 'operations_ccm_500', 'the_geom', ST_CoordDim(the_geom), ST_SRID(the_geom), GeometryType(the_geom) 
    579 FROM dbeel.operations_ccm_500 LIMIT 1; 
     578SELECT '', 'dbeel', 'observation_places_ccm_500', 'the_geom', ST_CoordDim(the_geom), ST_SRID(the_geom), GeometryType(the_geom) 
     579FROM dbeel.observation_places_ccm_500 LIMIT 1; 
    580580-- creation d'index, clé primaire, et constraintes qui vont bien 
    581 alter table dbeel.operations_ccm_500 add CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2); 
    582 alter table dbeel.operations_ccm_500 add  CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'POINT'::text OR the_geom IS NULL); 
    583 alter table dbeel.operations_ccm_500 add  CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 3035); 
    584 alter table dbeel.operations_ccm_500 ADD CONSTRAINT pk_id PRIMARY KEY(id); 
    585 CREATE INDEX indexstation_ccm_500 ON dbeel.operations_ccm_500 
     581alter table dbeel.observation_places_ccm_500 add CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2); 
     582alter table dbeel.observation_places_ccm_500 add  CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'POINT'::text OR the_geom IS NULL); 
     583alter table dbeel.observation_places_ccm_500 add  CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 3035); 
     584alter table dbeel.observation_places_ccm_500 ADD CONSTRAINT pk_id PRIMARY KEY(id); 
     585CREATE INDEX indexstation_ccm_500 ON dbeel.observation_places_ccm_500 
    586586  USING GIST ( the_geom GIST_GEOMETRY_OPS ); 
    587587