Changes between Version 84 and Version 85 of CookBook join ROE_CCM


Ignore:
Timestamp:
May 6, 2010 4:30:44 PM (15 years ago)
Author:
cedric
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CookBook join ROE_CCM

    v84 v85  
    137137 * gid 
    138138 * dam_height 
    139  * dam_score 
     139 * dam_score (for the moment defaut is zero) 
    140140{{{ 
    141141CREATE INDEX indexgeobs ON geobs2010.obstacle_referentiel  USING GIST (ref_position_etrs89 GIST_GEOMETRY_OPS); 
    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, ref_position_etrs89 as the_geom FROM ( 
    145                SELECT ref_id, gid ,CAST(distance(r.the_geom, b.ref_position_etrs89) as  decimal(15,1)) as distance ,b.ref_position_etrs89 
     144        SELECT distinct on (ref_id) ref_id, gid, min(distance) as distance, height, score,ref_position_etrs89 as the_geom FROM ( 
     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               CASE WHEN  ref_hauteur_chute>0 then ref_hauteur_chute 
     147                    WHEN   ref_hauteur_chute=0 then ref_hauteur_chute 
     148                    ELSE  ref_hauteur_terrain 
     149                    END  AS height, 
     150                0 As score 
    146151               FROM geobs2010.obstacle_referentiel As b 
    147152               INNER JOIN  ccm21.riversegments r ON ST_DWithin(r.the_geom, b.ref_position_etrs89,300) 
    148153--             WHERE b.goodproj IS TRUE -- Attention c'est faux 
    149154               ORDER BY ref_id) AS sub  
    150         GROUP BY ref_id, distance, gid, the_geom 
    151 ); --53s 
    152  
    153  
     155        GROUP BY ref_id, distance, gid,height,score, the_geom 
     156);  
    154157-- mise à jour de la table geometry_columns 
    155158select Probe_Geometry_Columns();