Changes between Version 30 and Version 31 of CookBook join RHT-BDMAP


Ignore:
Timestamp:
Oct 17, 2011 5:06:26 PM (14 years ago)
Author:
laurent
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CookBook join RHT-BDMAP

    v30 v31  
    282282 
    283283}}} 
     284 
     285Travail Laurent -- récupération du tronçon à partir des coordonnées des stations 
     286UPDATE station_geography 
     287        SET id_bdcarthage_troncon = id_bdcarth, id_bdcarthage_cours_d_eau = c_hyd_cdo, nom_cours_d_eau = toponyme1 
     288        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 
     289        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