Changes between Initial Version and Version 1 of Verification BDCarthage-ROE


Ignore:
Timestamp:
Sep 16, 2011 5:46:16 PM (14 years ago)
Author:
celine
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Verification BDCarthage-ROE

    v1 v1  
     1back to first page[..][[BR]] 
     2back to ["RHT"][[BR]] 
     3 
     4A FINIR 
     5{{{ 
     6-- creation de la table noeudbdcarthage_rht_roe, je rajoute un the_geom a la requete pour pouvoir voir la table dans Qgis   
     7DROP TABLE IF EXISTS rht.noeudbdcarthage_rht_roe; 
     8CREATE TABLE rht.noeudbdcarthage_rht_roe as ( 
     9        SELECT distinct on (id_bdcarth) id_bdcarth, id_drain, min(distance) as distance, the_geom FROM ( 
     10               SELECT id_bdcarth, s.gid, id_drain ,CAST(distance(r.the_geom, s.the_geom) as  decimal(15,1)) as distance,s.the_geom  
     11               FROM bd_carthage2011.noeud_hydrographique As s 
     12               INNER JOIN  rht.rht_roev2 r ON ST_DWithin(r.the_geom, s.the_geom,300) 
     13               WHERE s.the_geom IS NOT NULL 
     14               ORDER BY id_bdcarth) AS sub  
     15        GROUP BY id_bdcarth, distance,id_drain, gid, the_geom 
     16); 
     17alter table rht.noeudbdcarthage_rht_roe add column id serial; 
     18-- mise à jour de la table geometry_columns 
     19INSERT INTO geometry_columns(f_table_catalog, f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, "type") 
     20SELECT '', 'rht', 'noeudbdcarthage_rht_roe', 'the_geom', ST_CoordDim(the_geom), ST_SRID(the_geom), GeometryType(the_geom) 
     21FROM rht.noeudbdcarthage_rht_roe LIMIT 1; 
     22 
     23-- creation d'index, clé primaire, et constraintes qui vont bien 
     24alter table rht.noeudbdcarthage_rht_roe add CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2); 
     25alter table rht.noeudbdcarthage_rht_roe add  CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'POINT'::text OR the_geom IS NULL); 
     26alter table rht.noeudbdcarthage_rht_roe add  CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 3035); 
     27alter table rht.noeudbdcarthage_rht_roe ADD CONSTRAINT pk_id PRIMARY KEY(id); 
     28CREATE INDEX indexbdmap_rht ON rht.bdmap_rht 
     29  USING GIST ( the_geom GIST_GEOMETRY_OPS ); 
     30}}}