Changes between Version 32 and Version 33 of CookBook join RHT-BDMAP


Ignore:
Timestamp:
Oct 18, 2011 12:01:47 PM (14 years ago)
Author:
cedric
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CookBook join RHT-BDMAP

    v32 v33  
    286286{{{ 
    287287#!sql  
     288-- script qui fonctionne uniquement chez Laurent (lien à la table "SIG" 
    288289UPDATE station_geography 
    289         SET id_bdcarthage_troncon = id_bdcarth, id_bdcarthage_cours_d_eau = c_hyd_cdo, nom_cours_d_eau = toponyme1 
    290         FROM "SIG".troncon_hydrographique, (SELECT sg_id, MIN(ST_Distance(troncon_hydrographique.the_geom, station_geography.the_geom)) AS min FROM station_geography, "SIG".troncon_hydrographique WHERE ST_Expand(station_geography.the_geom, 300) && troncon_hydrographique.the_geom GROUP BY sg_id) min_dist 
    291         WHERE station_geography.sg_id = min_dist.sg_id AND ST_Expand(station_geography.the_geom, 300) && troncon_hydrographique.the_geom AND ST_Distance(troncon_hydrographique.the_geom, station_geography.the_geom) = min_dist.min}}} 
     290        SET id_bdcarthage_troncon = id_bdcarth,  
     291        id_bdcarthage_cours_d_eau = c_hyd_cdo,  
     292        nom_cours_d_eau = toponyme1 
     293        FROM "SIG".troncon_hydrographique,  
     294        (SELECT sg_id, MIN(ST_Distance(troncon_hydrographique.the_geom, station_geography.the_geom)) AS min  
     295        FROM station_geography, "SIG".troncon_hydrographique 
     296         WHERE ST_Expand(station_geography.the_geom, 300) && troncon_hydrographique.the_geom GROUP BY sg_id) min_dist 
     297        WHERE station_geography.sg_id = min_dist.sg_id  
     298        AND ST_Expand(station_geography.the_geom, 300) && troncon_hydrographique.the_geom  
     299        AND ST_Distance(troncon_hydrographique.the_geom, station_geography.the_geom) = min_dist.min 
     300-- test de cédric 
     301/* 
     302e: 
     303cd E:\IAV\eda\bdmap 
     304psql -h localhost -U postgres --verbose  --file "station_geography.sql" eda2.0_RHT 
     305alter table station_geography set schema bdmap2009; 
     306*/ 
     307SET search_path TO bdmap2009, public; -- vous la connaissez celle là ? 
     308SELECT * FROM station_geography; --11379 
     309select  * from station_geography sg join station st on st.st_codecsp=sg.st_codecsp; --11379 c'est effectivement la même chose.... 
     310}}}