Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Exploration Lettre Eolien PV Trim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DREAL Pays de la Loire
Centre de Services de la Donnée
Exploration Lettre Eolien PV Trim
Commits
0bdf3614
Commit
0bdf3614
authored
3 years ago
by
Franck.Gaspard
Browse files
Options
Downloads
Patches
Plain Diff
réponses aux tickets 2, 3 et 4
parent
02fb61c4
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
explo_eolien.R
+10
-10
10 additions, 10 deletions
explo_eolien.R
server.R
+23
-8
23 additions, 8 deletions
server.R
ui.R
+8
-8
8 additions, 8 deletions
ui.R
with
41 additions
and
26 deletions
explo_eolien.R
+
10
−
10
View file @
0bdf3614
...
@@ -45,17 +45,17 @@ parcs_eolien_mats <- select(parcs_eolien, id_parc, nom_parc, dep) %>%
...
@@ -45,17 +45,17 @@ parcs_eolien_mats <- select(parcs_eolien, id_parc, nom_parc, dep) %>%
full_join
(
mats_eolien_1
%>%
st_drop_geometry
()
%>%
full_join
(
mats_eolien_1
%>%
st_drop_geometry
()
%>%
select
(
id_parc
,
id_mat
,
etat_mat
,
en_service
,
date_prod
,
id_au
,
pu_nominal
),
select
(
id_parc
,
id_mat
,
etat_mat
,
en_service
,
date_prod
,
id_au
,
pu_nominal
),
by
=
"id_parc"
)
%>%
by
=
"id_parc"
)
%>%
right_join
(
mats_eolien_2
%>%
select
(
id_mat
,
starts_with
(
"etat_"
),
starts_with
(
"date_"
),
starts_with
(
"nb_mats"
),
right_join
(
mats_eolien_2
%>%
select
(
id_mat
,
demandeur
,
starts_with
(
"etat_"
),
starts_with
(
"date_"
),
starts_with
(
"nb_mats"
),
starts_with
(
"puissance_"
),
starts_with
(
"nb_mats_"
)),
.
,
by
=
"id_mat"
)
%>%
starts_with
(
"puissance_"
),
starts_with
(
"nb_mats_"
)),
.
,
by
=
"id_mat"
)
%>%
mutate
(
dep
=
substr
(
id_parc
,
1
,
2
))
mutate
(
dep
=
substr
(
id_parc
,
1
,
2
))
# names(parcs_eolien_mats)
# names(parcs_eolien_mats)
# [1] "id_mat" "etat_eolienne" "etat_service"
"etat_autorisation"
# [1] "id_mat"
"demandeur"
"etat_eolienne" "etat_service"
# [5] "etat_autorisation_mat" "date_depot" "date_derniere_decision"
"date_realisation"
# [5]
"etat_autorisation"
"etat_autorisation_mat" "date_depot" "date_derniere_decision"
# [9] "nb_mats_demandes" "nb_mats_autorises" "puissance_nominale_parc"
"puissance_nominale_eolienne"
# [9]
"date_realisation"
"nb_mats_demandes" "nb_mats_autorises" "puissance_nominale_parc"
# [13] "id_parc" "nom_parc" "dep"
"etat_mat"
# [13]
"puissance_nominale_eolienne"
"id_parc" "nom_parc" "dep"
# [17] "en_service" "date_prod" "id_au"
"pu_nominal"
# [17]
"etat_mat"
"en_service" "date_prod" "id_au"
# [21] "geometry"
# [21]
"pu_nominal"
"geometry"
# table des parcs avec info sur date autorisation et de dépot
# table des parcs avec info sur date autorisation et de dépot
parcs_eolien_tableau
<-
parcs_eolien_mats
%>%
parcs_eolien_tableau
<-
parcs_eolien_mats
%>%
...
@@ -66,8 +66,8 @@ parcs_eolien_tableau <- parcs_eolien_mats %>%
...
@@ -66,8 +66,8 @@ parcs_eolien_tableau <- parcs_eolien_mats %>%
trim_refus
=
if_else
(
etat_autorisation_mat
==
"NAU"
,
quarter
(
ymd
(
date_derniere_decision
),
type
=
"year.quarter"
),
NA_real_
),
trim_refus
=
if_else
(
etat_autorisation_mat
==
"NAU"
,
quarter
(
ymd
(
date_derniere_decision
),
type
=
"year.quarter"
),
NA_real_
),
# redressement de la base : une saisie par erreur au niveau de la date de production
# redressement de la base : une saisie par erreur au niveau de la date de production
trim_mes
=
if_else
(
is.na
(
trim_autorisation
),
NA_real_
,
trim_mes
))
%>%
trim_mes
=
if_else
(
is.na
(
trim_autorisation
),
NA_real_
,
trim_mes
))
%>%
select
(
dep
,
id_parc
,
nom_parc
,
etat_autorisation_parc
=
etat_autorisation
,
starts_with
(
"trim_"
),
puissance_nominale_parc
,
id_mat
)
%>%
select
(
dep
,
id_parc
,
nom_parc
,
etat_autorisation_parc
=
etat_autorisation
,
starts_with
(
"trim_"
),
puissance_nominale_parc
,
id_mat
,
demandeur
)
%>%
group_by
(
dep
,
id_parc
,
nom_parc
,
etat_autorisation_parc
,
across
(
starts_with
(
"trim_"
)),
puissance_nominale_parc
)
%>%
group_by
(
dep
,
id_parc
,
nom_parc
,
etat_autorisation_parc
,
demandeur
,
across
(
starts_with
(
"trim_"
)),
puissance_nominale_parc
)
%>%
summarise
(
nb_mats
=
n_distinct
(
id_mat
),
.groups
=
"drop"
)
%>%
summarise
(
nb_mats
=
n_distinct
(
id_mat
),
.groups
=
"drop"
)
%>%
mutate
(
across
(
starts_with
(
"trim_"
),
as.character
))
mutate
(
across
(
starts_with
(
"trim_"
),
as.character
))
...
@@ -75,7 +75,7 @@ parcs_eolien_geom <- select(parcs_eolien, id_parc, nom_parc, exploitant) %>%
...
@@ -75,7 +75,7 @@ parcs_eolien_geom <- select(parcs_eolien, id_parc, nom_parc, exploitant) %>%
filter
(
id_parc
%in%
parcs_eolien_tableau
$
id_parc
)
filter
(
id_parc
%in%
parcs_eolien_tableau
$
id_parc
)
mat_eolien_geom
<-
filter
(
parcs_eolien_mats
,
id_parc
%in%
parcs_eolien_tableau
$
id_parc
)
%>%
mat_eolien_geom
<-
filter
(
parcs_eolien_mats
,
id_parc
%in%
parcs_eolien_tableau
$
id_parc
)
%>%
select
(
id_parc
,
nom_parc
,
id_mat
)
select
(
id_parc
,
nom_parc
,
id_mat
,
demandeur
)
## Exploitation des données SIGLOIRE --------------
## Exploitation des données SIGLOIRE --------------
...
...
This diff is collapsed.
Click to expand it.
server.R
+
23
−
8
View file @
0bdf3614
...
@@ -7,11 +7,12 @@ function(input, output, session) {
...
@@ -7,11 +7,12 @@ function(input, output, session) {
instruction
<-
etat_parc_instruction_trim
(
input
$
select_trim
,
indicateurs
=
TRUE
)
instruction
<-
etat_parc_instruction_trim
(
input
$
select_trim
,
indicateurs
=
TRUE
)
autorises
<-
etat_parc_autorise_trim
(
input
$
select_trim
,
indicateurs
=
TRUE
)
autorises
<-
etat_parc_autorise_trim
(
input
$
select_trim
,
indicateurs
=
TRUE
)
construit
<-
etat_parc_construits_trim
(
input
$
select_trim
,
indicateurs
=
TRUE
)
construit
<-
etat_parc_construits_trim
(
input
$
select_trim
,
indicateurs
=
TRUE
)
tableau
<-
instruction
%>%
tableau
<-
autorises
%>%
left_join
(
autorises
,
by
=
"zone"
)
%>%
left_join
(
construit
,
by
=
"zone"
)
%>%
left_join
(
construit
,
by
=
"zone"
)
%>%
left_join
(
instruction
,
by
=
"zone"
)
%>%
select
(
-
starts_with
(
"nb_mats"
))
%>%
select
(
-
starts_with
(
"nb_mats"
))
%>%
mutate_if
(
is.numeric
,
as.integer
)
mutate_if
(
is.numeric
,
as.integer
)
%>%
select
(
zone
,
nb_parcs_instruc
,
puiss_MW_instruc
,
nb_parcs_autor
,
puiss_MW_autor
,
nb_parcs_en_serv
,
puiss_MW_en_serv
)
return
(
tableau
)
return
(
tableau
)
})
})
...
@@ -141,23 +142,37 @@ function(input, output, session) {
...
@@ -141,23 +142,37 @@ function(input, output, session) {
etat_parc_refuses_trim_carte
<-
reactive
({
etat_parc_refuses_trim_carte
<-
reactive
({
etat_parc_refuses_trim
(
input
$
select_trim
,
indicateurs
=
FALSE
,
nouveau
=
TRUE
)
%>%
etat_parc_refuses_trim
(
input
$
select_trim
,
indicateurs
=
FALSE
,
nouveau
=
TRUE
)
%>%
select
(
id_parc
,
nom_parc
,
puissance_nominale_parc
)
%>%
select
(
id_parc
,
nom_parc
,
puissance_nominale_parc
)
%>%
right_join
(
parcs_eolien_geom
,
.
,
by
=
'id_parc'
)
# voir le recensement des parcs refusés dans explo_eolien.R
right_join
(
parcs_eolien_geom
,
.
,
by
=
'id_parc'
)
})
})
mat_parc_refuses
<-
reactive
({
mat_parc_refuses
<-
reactive
({
mat_eolien_geom
%>%
semi_join
(
etat_parc_refuses_trim_carte
()
%>%
st_drop_geometry
())
mat_eolien_geom
%>%
semi_join
(
etat_parc_refuses_trim_carte
()
%>%
st_drop_geometry
())
})
})
test_etat_parc_refuses_trim_carte
<-
reactive
({
test
<-
semi_join
(
etat_parc_refuses_trim
(
input
$
select_trim
,
indicateurs
=
FALSE
,
nouveau
=
TRUE
)
%>%
select
(
id_parc
,
nom_parc
,
puissance_nominale_parc
),
parcs_eolien_geom
,
by
=
'id_parc'
)
nrow
(
test
)
})
output
$
map_parc_refuses
<-
renderLeaflet
({
output
$
map_parc_refuses
<-
renderLeaflet
({
(
mapview
(
etat_parc_refuses_trim_carte
(),
legend
=
FALSE
)
+
mapview
(
mat_parc_refuses
(),
legend
=
FALSE
))
@
map
%>%
if
(
test_etat_parc_refuses_trim_carte
()
==
0
)({
addFullscreenControl
()
(
mapview
(
mat_parc_refuses
(),
legend
=
FALSE
))
@
map
%>%
addFullscreenControl
()
})
else
({
(
mapview
(
etat_parc_refuses_trim_carte
(),
legend
=
FALSE
)
+
mapview
(
mat_parc_refuses
(),
legend
=
FALSE
))
@
map
%>%
addFullscreenControl
()
})
})
})
output
$
liste_parc_refuses
<-
renderTable
({
output
$
liste_parc_refuses
<-
renderTable
({
etat_parc_refuses_trim
(
input
$
select_trim
,
indicateurs
=
FALSE
,
nouveau
=
TRUE
)
%>%
etat_parc_refuses_trim
(
input
$
select_trim
,
indicateurs
=
FALSE
,
nouveau
=
TRUE
)
%>%
select
(
dep
,
id_parc
,
nom_parc
,
puissance_nominale_parc
)
%>%
select
(
dep
,
id_parc
,
nom_parc
,
demandeur
,
puissance_nominale_parc
)
%>%
arrange
(
id_parc
)
%>%
arrange
(
id_parc
)
%>%
mutate
(
nom_parc
=
ifelse
(
is.na
(
nom_parc
),
"pas de nom"
,
nom_parc
))
# PROBLEME : le tableau n'affiche aucune valeur !? -----
mutate
(
nom_parc
=
ifelse
(
is.na
(
nom_parc
),
"pas de nom"
,
nom_parc
))
})
})
}
}
This diff is collapsed.
Click to expand it.
ui.R
+
8
−
8
View file @
0bdf3614
...
@@ -34,42 +34,42 @@ sidebarLayout(
...
@@ -34,42 +34,42 @@ sidebarLayout(
width
=
12
,
width
=
12
,
height
=
1000
,
height
=
1000
,
tabPanel
(
title
=
"Parcs en instruction"
,
tabPanel
(
title
=
"Parcs en instruction"
,
box
(
width
=
5
,
box
(
width
=
6
,
tags
$
h4
(
"liste des parcs en instruction"
),
tags
$
h4
(
"liste des parcs en instruction"
),
tableOutput
(
"liste_parc_instruction"
)
tableOutput
(
"liste_parc_instruction"
)
),
),
box
(
width
=
7
,
box
(
width
=
6
,
tags
$
h4
(
"carte des nouveaux parcs du trimestre"
),
tags
$
h4
(
"carte des nouveaux parcs du trimestre"
),
mapviewOutput
(
outputId
=
"map_parc_instruction"
)
mapviewOutput
(
outputId
=
"map_parc_instruction"
)
)
)
),
),
tabPanel
(
title
=
"Parcs autorisés"
,
tabPanel
(
title
=
"Parcs autorisés"
,
box
(
width
=
5
,
box
(
width
=
6
,
tags
$
h4
(
"liste des parcs autorisés"
),
tags
$
h4
(
"liste des parcs autorisés"
),
tableOutput
(
"liste_parc_autorise"
)
tableOutput
(
"liste_parc_autorise"
)
),
),
box
(
box
(
width
=
7
,
width
=
6
,
tags
$
h4
(
"carte des nouveaux parcs du trimestre"
),
tags
$
h4
(
"carte des nouveaux parcs du trimestre"
),
mapviewOutput
(
outputId
=
"map_parc_autorise"
)
mapviewOutput
(
outputId
=
"map_parc_autorise"
)
)
)
),
),
tabPanel
(
title
=
"Parcs mis en service"
,
tabPanel
(
title
=
"Parcs mis en service"
,
box
(
width
=
5
,
box
(
width
=
6
,
tags
$
h4
(
"liste des parcs en service"
),
tags
$
h4
(
"liste des parcs en service"
),
tableOutput
(
"liste_parc_construits"
)
tableOutput
(
"liste_parc_construits"
)
),
),
box
(
width
=
7
,
box
(
width
=
6
,
tags
$
h4
(
"carte des nouveaux parcs du trimestre"
),
tags
$
h4
(
"carte des nouveaux parcs du trimestre"
),
mapviewOutput
(
outputId
=
"map_parc_construits"
)
mapviewOutput
(
outputId
=
"map_parc_construits"
)
)
)
),
),
tabPanel
(
title
=
"Parcs refusés"
,
tabPanel
(
title
=
"Parcs refusés"
,
box
(
width
=
5
,
box
(
width
=
6
,
tags
$
h4
(
"liste des parcs refusés"
),
tags
$
h4
(
"liste des parcs refusés"
),
tableOutput
(
"liste_parc_refuses"
)
tableOutput
(
"liste_parc_refuses"
)
),
),
box
(
width
=
7
,
box
(
width
=
6
,
tags
$
h4
(
"carte des parcs refusés"
),
tags
$
h4
(
"carte des parcs refusés"
),
mapviewOutput
(
outputId
=
"map_parc_refuses"
)
mapviewOutput
(
outputId
=
"map_parc_refuses"
)
)
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment