Changes between Version 84 and Version 85 of CookBook join ROE_CCM
- Timestamp:
- May 6, 2010 4:30:44 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CookBook join ROE_CCM
v84 v85 137 137 * gid 138 138 * dam_height 139 * dam_score 139 * dam_score (for the moment defaut is zero) 140 140 {{{ 141 141 CREATE INDEX indexgeobs ON geobs2010.obstacle_referentiel USING GIST (ref_position_etrs89 GIST_GEOMETRY_OPS); 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, 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 146 151 FROM geobs2010.obstacle_referentiel As b 147 152 INNER JOIN ccm21.riversegments r ON ST_DWithin(r.the_geom, b.ref_position_etrs89,300) 148 153 -- WHERE b.goodproj IS TRUE -- Attention c'est faux 149 154 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 ); 154 157 -- mise à jour de la table geometry_columns 155 158 select Probe_Geometry_Columns();