Changes between Version 5 and Version 6 of Meuse dbeel


Ignore:
Timestamp:
May 26, 2014 4:45:18 PM (11 years ago)
Author:
cedric
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Meuse dbeel

    v5 v6  
    66mettre à jour avec des données plus récentes. 
    77 [[Image(source:data/Docs/trac/Meuse/pechefrancebelgique.jpg)]] [[BR]] 
     8{{{#!sql 
    89 
     10-- insertion données Laura 
     11create schema belge; 
     12alter table stations set schema belge; 
     13alter table mesures_ang set schema belge; 
     14alter table obstacles set schema belge; 
     15alter table anguilles set schema belge; 
     16 
     17 
     18set search_path to belge,public,dbeel; 
     19select * from belge.stations; 
     20select st_srid(the_geom) from belge.stations;--103300 
     21--103300 est le code ESRI mais ce n'est pas un ESPG qui est 31370 
     22update belge.stations set the_geom=st_setsrid(the_geom,31370); 
     23update belge.stations set the_geom=st_transform(the_geom,3035);--2484 
     24alter table belge.stations  ADD CONSTRAINT station_pkey PRIMARY KEY (st_id ), 
     25  CONSTRAINT enforce_dims_the_geom CHECK (st_ndims(the_geom) = 2), 
     26  CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'POINT'::text OR the_geom IS NULL), 
     27  CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 27572), 
     28  CONSTRAINT geometry_valid_check CHECK (isvalid(the_geom)); 
     29 
     30 
     31--Meuse 
     32INSERT INTO  dbeel.establishment (et_establishment_name) VALUES ('SPW'); 
     33INSERT INTO dbeel.data_provider(dp_name, dp_et_id) VALUES ('Laura',7); 
     34 
     35alter table stations rename to operations; 
     36create table stations as select distinct on (site) site, organisme, eau,commune, lambex,lambey, code_precxy, the_geom from operations  
     37where code_typpec= 'PECHEELECTRIQUE'; 
     38alter table stations add constraint c_pk_stations PRIMARY KEY (site); 
     39 
     40DROP TABLE if exists belge.stationdbeel CASCADE; 
     41CREATE TABLE belge.stationdbeel ( 
     42        LIKE belge.stations, 
     43        CONSTRAINT pk_so_op_id PRIMARY KEY (op_id), 
     44        CONSTRAINT fk_so_observation_place_type_id FOREIGN KEY (op_no_observationplacetype)  
     45                REFERENCES dbeel_nomenclature.observation_place_type (no_id)  
     46                MATCH SIMPLE ON UPDATE CASCADE ON DELETE RESTRICT 
     47) INHERITS (dbeel.observation_places); 
     48 
     49INSERT INTO belge.stationdbeel 
     50        SELECT  uuid_generate_v4() AS op_id, 
     51        'SPW' AS op_gis_systemname , 
     52        'STATIONS' AS op_gis_layername,  
     53        st.site AS op_gislocation, 
     54        site AS op_placename, 
     55        10 AS op_no_observationplacetype, -- Sampling station 
     56        NULL AS  op_op_id, 
     57        the_geom, 
     58        site, organisme, eau,commune, lambex,lambey, code_precxy FROM belge.stations st ; -- 563 lines 
     59}}} 
    960==Intégration des stations dans stationdbeel== 
    1061On vire les passes à poissons.