Changes between Version 85 and Version 86 of CookBook join ROE_CCM
- Timestamp:
- May 6, 2010 5:11:57 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CookBook join ROE_CCM
v85 v86 142 142 DROP TABLE IF EXISTS geobs2010.roe_ccm_300; 143 143 CREATE TABLE geobs2010.roe_ccm_300 as ( 144 SELECT distinct on (ref_id) ref_id, gid, min(distance) as distance, height, score, ref_position_etrs89 as the_geom FROM (144 SELECT distinct on (ref_id) ref_id, gid, min(distance) as distance, height, score,nbdams,ref_position_etrs89 as the_geom FROM ( 145 145 SELECT ref_id, gid ,CAST(distance(r.the_geom, b.ref_position_etrs89) as decimal(15,1)) as distance ,b.ref_position_etrs89, 146 146 CASE WHEN ref_hauteur_chute>0 then ref_hauteur_chute … … 148 148 ELSE ref_hauteur_terrain 149 149 END AS height, 150 0 As score 150 0 As score, 151 1 AS nbdams -- pour jointure ultérieure 151 152 FROM geobs2010.obstacle_referentiel As b 152 153 INNER JOIN ccm21.riversegments r ON ST_DWithin(r.the_geom, b.ref_position_etrs89,300) 153 154 -- WHERE b.goodproj IS TRUE -- Attention c'est faux 154 155 ORDER BY ref_id) AS sub 155 GROUP BY ref_id, distance, gid,height,score, the_geom156 GROUP BY ref_id, distance, gid,height,score,nbdams the_geom 156 157 ); 157 158 -- mise à jour de la table geometry_columns