Changes between Version 33 and Version 34 of Noeud - parcours RHT


Ignore:
Timestamp:
Jan 5, 2012 3:17:56 PM (13 years ago)
Author:
celine
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Noeud - parcours RHT

    v33 v34  
    169169{{{ 
    170170#!sql 
    171 -- creation de la table bdmap2009.bdmap_rhtvs2, je rajoute un the_geom a la requete pour pouvoir voir la table dans Qgis   
     171-- creation de la table bdmap2009.bdmap_rht, je rajoute un the_geom a la requete pour pouvoir voir la table dans Qgis   
    172172DROP TABLE IF EXISTS bdmap2009.bdmap_rhtvs2; 
    173173CREATE TABLE bdmap2009.bdmap_rhtvs2 as ( 
    174         SELECT distinct on (st_codecsp) st_codecsp, id_drain, min(distance) as distance, the_geom FROM ( 
    175                SELECT st_codecsp, id_drain ,CAST(distance(r.the_geom, s.the_geom) as  decimal(15,1)) as distance,s.the_geom  
    176                FROM bdmap2009.stationsp2 As s 
     174        SELECT distinct on (st_codecsp) st_codecsp, id_drain, min(distance) as distance, nom_station, source, bien_projetee, id_bdcarthage_troncon, id_bdcarthage_cours_d_eau, insee_comm,  
     175                nom_commun, date_maj, a_conserver, commentaire, verifie, the_geom FROM ( 
     176               SELECT st_codecsp, nom_station, source, bien_projetee, id_bdcarthage_troncon, id_bdcarthage_cours_d_eau, insee_comm,  
     177                nom_commun, date_maj, a_conserver, commentaire, verifie, r.id_drain ,CAST(distance(r.the_geom, s.the_geom) as  decimal(15,1)) as distance,s.the_geom  
     178               FROM bdmap2009.station_geography As s 
    177179               INNER JOIN  rht.rhtvs2 r ON ST_DWithin(r.the_geom, s.the_geom,300) 
    178180               WHERE s.the_geom IS NOT NULL 
    179181               ORDER BY st_codecsp) AS sub  
    180         GROUP BY st_codecsp, distance,id_drain, the_geom 
    181 ); 
     182        GROUP BY st_codecsp, id_drain, distance, nom_station, source, bien_projetee, id_bdcarthage_troncon, id_bdcarthage_cours_d_eau, insee_comm,  
     183                nom_commun, date_maj, a_conserver, commentaire, verifie, the_geom 
     184);  ---2094 ms 
    182185alter table bdmap2009.bdmap_rhtvs2 add column id serial; 
    183186-- mise à jour de la table geometry_columns 
     
    191194alter table bdmap2009.bdmap_rhtvs2 add  CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 3035); 
    192195alter table bdmap2009.bdmap_rhtvs2 ADD CONSTRAINT pk_id PRIMARY KEY(id); 
    193 CREATE INDEX indexbdmap_rht ON bdmap2009.bdmap_rhtvs2 
     196CREATE INDEX indexbdmap_rhtvs2 ON bdmap2009.bdmap_rhtvs2 
    194197  USING GIST ( the_geom GIST_GEOMETRY_OPS ); 
    195198}}}