Changes between Version 31 and Version 32 of CookBook join RHT-BDMAP
- Timestamp:
- Oct 17, 2011 5:07:25 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CookBook join RHT-BDMAP
v31 v32 284 284 285 285 Travail Laurent -- récupération du tronçon à partir des coordonnées des stations 286 {{{ 287 #!sql 286 288 UPDATE station_geography 287 289 SET id_bdcarthage_troncon = id_bdcarth, id_bdcarthage_cours_d_eau = c_hyd_cdo, nom_cours_d_eau = toponyme1 288 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 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 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}}}