Changes between Version 85 and Version 86 of CookBook join ROE_CCM


Ignore:
Timestamp:
May 6, 2010 5:11:57 PM (15 years ago)
Author:
cedric
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CookBook join ROE_CCM

    v85 v86  
    142142DROP TABLE IF EXISTS geobs2010.roe_ccm_300; 
    143143CREATE 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 ( 
    145145               SELECT ref_id, gid ,CAST(distance(r.the_geom, b.ref_position_etrs89) as  decimal(15,1)) as distance ,b.ref_position_etrs89, 
    146146               CASE WHEN  ref_hauteur_chute>0 then ref_hauteur_chute 
     
    148148                    ELSE  ref_hauteur_terrain 
    149149                    END  AS height, 
    150                 0 As score 
     150                0 As score, 
     151                1 AS nbdams -- pour jointure ultérieure 
    151152               FROM geobs2010.obstacle_referentiel As b 
    152153               INNER JOIN  ccm21.riversegments r ON ST_DWithin(r.the_geom, b.ref_position_etrs89,300) 
    153154--             WHERE b.goodproj IS TRUE -- Attention c'est faux 
    154155               ORDER BY ref_id) AS sub  
    155         GROUP BY ref_id, distance, gid,height,score, the_geom 
     156        GROUP BY ref_id, distance, gid,height,score,nbdams the_geom 
    156157);  
    157158-- mise à jour de la table geometry_columns