Changes between Version 33 and Version 34 of Noeud - parcours RHT
- Timestamp:
- Jan 5, 2012 3:17:56 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Noeud - parcours RHT
v33 v34 169 169 {{{ 170 170 #!sql 171 -- creation de la table bdmap2009.bdmap_rht vs2, je rajoute un the_geom a la requete pour pouvoir voir la table dans Qgis171 -- creation de la table bdmap2009.bdmap_rht, je rajoute un the_geom a la requete pour pouvoir voir la table dans Qgis 172 172 DROP TABLE IF EXISTS bdmap2009.bdmap_rhtvs2; 173 173 CREATE 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 177 179 INNER JOIN rht.rhtvs2 r ON ST_DWithin(r.the_geom, s.the_geom,300) 178 180 WHERE s.the_geom IS NOT NULL 179 181 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 182 185 alter table bdmap2009.bdmap_rhtvs2 add column id serial; 183 186 -- mise à jour de la table geometry_columns … … 191 194 alter table bdmap2009.bdmap_rhtvs2 add CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 3035); 192 195 alter table bdmap2009.bdmap_rhtvs2 ADD CONSTRAINT pk_id PRIMARY KEY(id); 193 CREATE INDEX indexbdmap_rht ON bdmap2009.bdmap_rhtvs2196 CREATE INDEX indexbdmap_rhtvs2 ON bdmap2009.bdmap_rhtvs2 194 197 USING GIST ( the_geom GIST_GEOMETRY_OPS ); 195 198 }}}