Changes between Version 12 and Version 13 of Meuse dbeel


Ignore:
Timestamp:
Jun 6, 2014 4:12:46 PM (11 years ago)
Author:
laura
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Meuse dbeel

    v12 v13  
    593593 [[Image(source:data/Docs/trac/Meuse/projection_op_meuse.jpg)]] [[BR]] 
    594594 [[Image(source:data/Docs/trac/Meuse/projection_op_meuse_zoom.jpg)]] [[BR]] 
     595 
     596{{{#!sql 
     597 
     598----------------------------------------------------------------------------- 
     599-- Creation de la table stations_ccm_500 avec l'id station et l'id de la CCM 
     600----------------------------------------------------------------------------- 
     601 
     602-- Table pour les stations 
     603-- Juste la Meuse belge car on doit attendre les données de pêches pour la hollande et la France 
     604  DROP TABLE IF EXISTS dbeel.stations_ccm_500; 
     605CREATE TABLE belge.stations_ccm_500 as ( 
     606        SELECT distinct (site) site, gid, wso1_id, min(distance) as distance, the_geom FROM (   
     607               SELECT site, gid, wso1_id, distance, s.the_geom  
     608               FROM dbeel.observation_places_CCM_500 s 
     609               join belge.stationdbeel o ON o.op_id=s.op_id  
     610               WHERE s.the_geom IS NOT NULL 
     611               ORDER BY site) AS sub  
     612               GROUP BY site, gid, gid, wso1_id,  distance,the_geom -- 516 lignes pour Meuse 
     613); 
     614 
     615alter table belge.stations_ccm_500 add column id serial; 
     616-- mise à jour de la table geometry_columns 
     617INSERT INTO geometry_columns(f_table_catalog, f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, "type") 
     618SELECT '', 'belge', 'stations_ccm_500', 'the_geom', ST_CoordDim(the_geom), ST_SRID(the_geom), GeometryType(the_geom) 
     619FROM oria.oria_ccm_500 LIMIT 1; 
     620 
     621-- creation d'index, clé primaire, et constraintes qui vont bien 
     622alter table belge.stations_ccm_500 add CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2); 
     623alter table belge.stations_ccm_500 add  CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'POINT'::text OR the_geom IS NULL); 
     624alter table belge.stations_ccm_500 add  CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 3035); 
     625alter table belge.stations_ccm_500 ADD CONSTRAINT pk_id PRIMARY KEY(id); 
     626CREATE INDEX indexbelge_ccm_500 ON belge.stations_ccm_500 
     627  USING GIST ( the_geom GIST_GEOMETRY_OPS ); 
     628   
     629-- select * from belge.stations_ccm_500 
     630 
     631 
     632}}}