Changes between Version 6 and Version 7 of Noeuds mer RHT


Ignore:
Timestamp:
Oct 19, 2011 9:14:17 PM (14 years ago)
Author:
cedric
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Noeuds mer RHT

    v6 v7  
    3737); 
    3838 
     39-- je vais chercher dans la ccm les informations sur les distances mer et les cumuls de barrages 
     40 
     41select distinct on (zonegeo) zonegeo from rht.noeudmer; 
     42 
     43alter table rht.noeudmer add column cumnbbar integer; 
     44alter table rht.noeudmer add column dmer numeric; 
     45alter table rht.noeudmer add column wso1_id integer; 
     46 
     47 
     48update rht.noeudmer set (cumnbbar,dmer,wso1_id)= (jointure.cs_nbdams,jointure.cum_len_sea,jointure.wso1_id) from 
     49        -- resultat final de la jointure spatiale entre ccm et noeudfrontiere 
     50        (select distinct on (id_drain) id_drain, min(distance) as distance, wso1_id,cs_nbdams, cum_len_sea from ( 
     51                -- requete intermédiaire dont on prend le min (sub) 
     52                select id_drain, ST_distance(noeudfrontiere.the_geom,ccmrs.the_geom) as distance,ccmrs.* 
     53                FROM ccm.riversegments_france ccmrs join 
     54                (select id_drain, the_geom from rht.noeudmer where noeudmer and zonegeo in ('Est','pyrénées')) as noeudfrontiere 
     55                on ST_DWithin(noeudfrontiere.the_geom,ccmrs.the_geom, 500)) as sub 
     56        group by id_drain, distance, wso1_id,cs_nbdams, cum_len_sea) as jointure 
     57where noeudmer.id_drain=jointure.id_drain; --100 lignes modifiées 
    3958}}}