Changes between Version 5 and Version 6 of Anglian


Ignore:
Timestamp:
Jul 15, 2011 9:03:49 PM (14 years ago)
Author:
cedric
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Anglian

    v5 v6  
    1717= Projection = 
    1818British national grid reference srid=27700 
     19-- Sauvegarde de la table station depuis la dbeel vers la ccm 
     20{{{ 
     21e:  
     22cd E:\IAV\eda\anglian 
     23C:\"Program Files"\PostgreSQL\9.0\bin\pg_dump -h localhost -U postgres --table anglian.station  --file "anglian_station.sql" dbeel 
     24C:\"Program Files"\PostgreSQL\9.0\bin\psql -h 93.20.247.238 -U postgres  --file "anglian_station.sql" eda2 
     25}}} 
     26 
     27{{{ 
     28create schema anglian; 
     29}}} 
     30{{{ 
     31#!sql 
     32DROP TABLE IF EXISTS anglian.anglian_station_ccm_500; 
     33CREATE TABLE anglian.anglian_station_ccm_500 as ( 
     34        SELECT distinct on (site_id ) site_id , gid, wso1_id, min(distance) as distance, the_geom FROM ( 
     35               SELECT site_id, gid , wso1_id, CAST(distance(r.the_geom, s.the_geom) as  decimal(15,1)) as distance,s.the_geom  
     36               FROM anglian.station As s 
     37               INNER JOIN  ccm21.riversegments r ON ST_DWithin(r.the_geom, s.the_geom,500) 
     38               WHERE s.the_geom IS NOT NULL 
     39               ORDER BY site_id) AS sub  
     40        GROUP BY site_id, distance, gid, wso1_id, the_geom 
     41); 
     42alter table anglian.anglian_station_ccm_500 add column id serial; 
     43-- mise à jour de la table geometry_columns 
     44INSERT INTO geometry_columns(f_table_catalog, f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, "type") 
     45SELECT '', 'anglian', 'anglian_station_ccm_500', 'the_geom', ST_CoordDim(the_geom), ST_SRID(the_geom), GeometryType(the_geom) 
     46FROM anglian.anglian_station_ccm_500 LIMIT 1; 
     47-- creation d'index, clé primaire, et constraintes qui vont bien 
     48alter table anglian.anglian_station_ccm_500 add CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2); 
     49alter table anglian.anglian_station_ccm_500 add  CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'POINT'::text OR the_geom IS NULL); 
     50alter table anglian.anglian_station_ccm_500 add  CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 3035); 
     51alter table anglian.anglian_station_ccm_500 ADD CONSTRAINT pk_id PRIMARY KEY(id); 
     52CREATE INDEX indexstation_ccm_500 ON anglian.anglian_station_ccm_500 
     53  USING GIST ( the_geom GIST_GEOMETRY_OPS ); 
     54}}} 
     55 
     56{{{ 
     57C:\"Program Files"\PostgreSQL\9.0\bin\pg_dump -h 93.20.247.238 -U postgres --table anglian.station  --file "anglian_station_ccm_500.sql" eda2  
     58}}} 
     59 
     60 
    1961 
    2062= Obstacle =