wiki:Joining dams ROE on CCM

Version 13 (modified by celine, 14 years ago) (diff)

--

back to first page ..

Adding transborder river dams

Some dams must be reproject and the gid (or wso1_id) must be changed:

DROP table if exists geobs2010.roe_ccm_500_final_gid;
CREATE TABLE geobs2010.roe_ccm_500_final_gid as (
select distinct on (ref_id) * from geobs2010.roe_ccm_500_final
);
update geobs2010.roe_ccm_500_final_gid SET gid='266956' where ref_id='6186';
update geobs2010.roe_ccm_500_final_gid SET gid='266956' where ref_id='6187';
update geobs2010.roe_ccm_500_final_gid SET gid='266956' where ref_id='6188';
update geobs2010.roe_ccm_500_final_gid SET gid='243685' where ref_id='7372';
update geobs2010.roe_ccm_500_final_gid SET gid='243685' where ref_id='7371';
update geobs2010.roe_ccm_500_final_gid SET gid='244061' where ref_id='7918';
update geobs2010.roe_ccm_500_final_gid SET gid='235907' where ref_id='7908';
update geobs2010.roe_ccm_500_final_gid SET gid='282306' where ref_id='15460';
update geobs2010.roe_ccm_500_final_gid SET gid='234501' where ref_id='27704';
update geobs2010.roe_ccm_500_final_gid SET gid='298703' where ref_id='47867';

# TO DO
update geobs2010.roe_ccm_500_final_gid SET gid='294805' where ref_id='10362';
update geobs2010.roe_ccm_500_final_gid SET gid='291613' where ref_id='12546';


--Supression des doublons
--gid 298703
delete from geobs2010.roe_ccm_500_final_gid where ref_id in (select r.ref_id from geobs2010.roe_ccm_500_final r inner join geobs2010.obstacle_referentiel o on o.ref_id=r.ref_id where gid='298703' and ref_sta_id is null)
--gid 293773
delete from geobs2010.roe_ccm_500_final_gid where ref_id in (

#TO DO
Barrages mal projetés (à entrer dans la table roe_ccm_500_final_gid : Trois barrages projetés sur gid=265936 or doivent être projetés sur 266956 (wso1_id=379706).--> nb barrages à modifier et cs_nbdams à modifier pour segments à l'amont.

ref_idgid ds roe_ccm_500_finalA projeter sur gid
6186265936266956
6187265936266956
6188265936266956
7372233625243685
7371233625243685
7918242614244061
7908233411235907

#Requête pour vérifier si présente des barrages mal projetés select * from geobs2010.roe_ccm_500_final where distproj_bdcar-distproj_ccm>200

#Problème de doublons

select gid, id_trhyd, dist_source_bdcar, dist_sea_bdcar, height, distproj_bdcar, nbdams, distproj_ccm, count(dist_source_bdcar) as Doublons from geobs2010.roe_ccm_500_final group by dist_source_bdcar, gid, id_trhyd, dist_sea_bdcar, height, distproj_bdcar, nbdams, distproj_ccm order by doublons

select gid, id_trhyd, dist_source_bdcar, dist_sea_bdcar, height, distproj_bdcar, nbdams, distproj_ccm, count(distproj_ccm) as Doublons from geobs2010.roe_ccm_500_final group by dist_source_bdcar, gid, id_trhyd, dist_sea_bdcar, height, distproj_bdcar, nbdams, distproj_ccm order by doublons

A vérifier : gid=298703, 293773, 266956, 272629 (pas de statut la plupart du temps)

select * from geobs2010.roe_ccm_500_final where gid='298703'
select o.ref_id_national, r.*, o.ref_sta_id from geobs2010.roe_ccm_500_final r inner join geobs2010.obstacle_referentiel o on o.ref_id=r.ref_id where gid='298703'

In geobs2010.roe_ccm_500_final (see http://www.moulinsdefrance.org/ffam/DescriptifROE.pdf page 14)

Statutsta_idNb barrages (nb lignes)
En projet -mis hors service021
En construction -mis hors service135
Existant -mis en service/mis hors service223081
Obsolète - mis hors service32913
sans statut112136


EtatNb barrages (nb lignes)
0 - Validé35006
1 - Confirmé256
2 - Non validé2004

In "DescriptifROE": "Seuls les ouvrages validés ont été intégrés au référentiel des obstacles à l'écoulement" (page15)

#A vérifier "wso1_id"='341459' OR "wso1_id"='351706' OR "wso1_id"='341485'