Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OutilEnR_EtatdesLieux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
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 Grand Est
SCDD
OutilsEnR
OutilEnR_EtatdesLieux
Commits
b84fd74c
Commit
b84fd74c
authored
1 year ago
by
guillaume.jeffroy
Browse files
Options
Downloads
Patches
Plain Diff
Mise à jour de l'URL INSEE, correction sur la source des données biogaz estimé ou pas
parent
8f7ff0aa
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
data-raw/pipeline/1_registre_ODRE_biogaz.R
+6
-7
6 additions, 7 deletions
data-raw/pipeline/1_registre_ODRE_biogaz.R
data-raw/run_pipe.R
+3
-3
3 additions, 3 deletions
data-raw/run_pipe.R
dev/03_deploy.R
+1
-2
1 addition, 2 deletions
dev/03_deploy.R
with
10 additions
and
12 deletions
data-raw/pipeline/1_registre_ODRE_biogaz.R
+
6
−
7
View file @
b84fd74c
library
(
lubridate
)
library
(
lubridate
)
library
(
tidyr
)
library
(
tidyr
)
library
(
dplyr
)
library
(
sf
)
library
(
sf
)
library
(
forcats
)
library
(
forcats
)
...
@@ -277,21 +278,19 @@ registre_biogaz <- registre_enrichi1 %>%
...
@@ -277,21 +278,19 @@ registre_biogaz <- registre_enrichi1 %>%
unnest
(
cols
=
data_annuelles
)
%>%
unnest
(
cols
=
data_annuelles
)
%>%
select
(
id_unique_projet
,
production_de_biomethane_annuel_gwh_an
,
annee
)
%>%
select
(
id_unique_projet
,
production_de_biomethane_annuel_gwh_an
,
annee
)
%>%
full_join
(
a_redr
,
by
=
c
(
"id_unique_projet"
,
"annee"
))
%>%
full_join
(
a_redr
,
by
=
c
(
"id_unique_projet"
,
"annee"
))
%>%
mutate
(
production_de_biomethane_annuel_gwh_an
=
coalesce
(
production_de_biomethane_annuel_gwh_an
,
production_de_biomethane_annuel_gwh_an_est
)
)
%>%
select
(
-
production_de_biomethane_annuel_gwh_an_est
)
%>%
full_join
(
registre_enrichi1
%>%
select
(
-
data_annuelles
),
by
=
"id_unique_projet"
)
%>%
full_join
(
registre_enrichi1
%>%
select
(
-
data_annuelles
),
by
=
"id_unique_projet"
)
%>%
mutate
(
mutate
(
source
=
case_when
(
source
=
case_when
(
!
is.na
(
production_de_biomethane_annuel_gwh_an
)
~
grx_demandeur
,
!
is.na
(
production_de_biomethane_annuel_gwh_an
)
~
grx_demandeur
,
annee_1ere_mes
==
mil
+
1
~
NA_character_
,
annee_1ere_mes
==
mil
+
1
~
NA_character_
,
TRUE
~
"estim. DREAL"
TRUE
~
"estim. DREAL"
),
production_de_biomethane_annuel_gwh_an
=
coalesce
(
production_de_biomethane_annuel_gwh_an
,
production_de_biomethane_annuel_gwh_an_est
)
)
)
%>%
)
%>%
select
(
-
production_de_biomethane_annuel_gwh_an_est
)
%>%
filter
(
!
is.na
(
geometrie
))
%>%
filter
(
!
is.na
(
geometrie
))
%>%
mutate
(
geometry
=
st_as_sfc
(
geometrie
))
%>%
mutate
(
geometry
=
st_as_sfc
(
geometrie
))
%>%
st_as_sf
(
crs
=
EPSG_reg
)
st_as_sf
(
crs
=
EPSG_reg
)
...
...
This diff is collapsed.
Click to expand it.
data-raw/run_pipe.R
+
3
−
3
View file @
b84fd74c
...
@@ -31,7 +31,7 @@ nettoyer_workspace <- TRUE
...
@@ -31,7 +31,7 @@ nettoyer_workspace <- TRUE
# 2023
# 2023
url_ign_iris
<-
"https://data.geopf.fr/telechargement/download/CONTOURS-IRIS/CONTOURS-IRIS_3-0__SHP__FRA_2023-01-01/CONTOURS-IRIS_3-0__SHP__FRA_2023-01-01.7z"
url_ign_iris
<-
"https://data.geopf.fr/telechargement/download/CONTOURS-IRIS/CONTOURS-IRIS_3-0__SHP__FRA_2023-01-01/CONTOURS-IRIS_3-0__SHP__FRA_2023-01-01.7z"
url_ign_admin
<-
"https://data.geopf.fr/telechargement/download/ADMIN-EXPRESS/ADMIN-EXPRESS_3-2__SHP_WGS84G_FRA_2023-10-16/ADMIN-EXPRESS_3-2__SHP_WGS84G_FRA_2023-10-16.7z"
url_ign_admin
<-
"https://data.geopf.fr/telechargement/download/ADMIN-EXPRESS/ADMIN-EXPRESS_3-2__SHP_WGS84G_FRA_2023-10-16/ADMIN-EXPRESS_3-2__SHP_WGS84G_FRA_2023-10-16.7z"
url_insee
<-
"https://www.insee.fr/fr/statistiques/fichier/
20174
99/reference_IRIS_geo2023.zip"
url_insee
<-
"https://www.insee.fr/fr/statistiques/fichier/
7708
99
5
/reference_IRIS_geo2023.zip"
url_SDES_eolien
<-
"https://www.statistiques.developpement-durable.gouv.fr/media/7141/download?inline"
url_SDES_eolien
<-
"https://www.statistiques.developpement-durable.gouv.fr/media/7141/download?inline"
url_SDES_pv
<-
"https://www.statistiques.developpement-durable.gouv.fr/media/7140/download?inline"
url_SDES_pv
<-
"https://www.statistiques.developpement-durable.gouv.fr/media/7140/download?inline"
...
@@ -200,10 +200,10 @@ end_time <- Sys.time()
...
@@ -200,10 +200,10 @@ end_time <- Sys.time()
success_msg
(
"Mise à jour terminée avec succès !"
)
success_msg
(
"Mise à jour terminée avec succès !"
)
print
(
paste0
(
"Fin de la mise à jour : "
,
end_time
))
print
(
paste0
(
"Fin de la mise à jour : "
,
end_time
))
print
(
paste0
(
"Temps total de la mise à jour : "
,
round
(
difftime
(
end_time
,
start_time
,
units
=
"secs"
),
digits
=
2
),
" s"
))
print
(
paste0
(
"Temps total de la mise à jour : "
,
round
(
difftime
(
end_time
,
start_time
,
units
=
"secs"
),
digits
=
2
),
" s"
))
print
(
paste0
(
"Toutes les données (brutes et raffinées) de la mise à jour sont stockés dans
: "
,
dossier
))
print
(
paste0
(
"Toutes les données (brutes et raffinées) de la mise à jour sont stockés dans : "
,
dossier
))
cat
(
paste0
(
"Les données raffinées ont été copiées dans le dossier ./data/
cat
(
paste0
(
"Les données raffinées ont été copiées dans le dossier ./data/
Elles sont prêtes au deploiement, mais également visible si vous lancez l'application en local."
))
Elles sont prêtes au deploiement, mais également visible si vous lancez l'application en local."
))
cat
(
paste0
(
"Listes des fichiers mise à jours : \n"
,
paste0
(
list.files
(
"data/"
),
collapse
=
"\n "
)))
cat
(
paste0
(
"Listes des fichiers mise à jours : \n"
,
paste0
(
list.files
(
"data/"
),
collapse
=
"\n "
)
,
"\n"
))
# Nettoyage du workspace
# Nettoyage du workspace
if
(
nettoyer_workspace
){
if
(
nettoyer_workspace
){
...
...
This diff is collapsed.
Click to expand it.
dev/03_deploy.R
+
1
−
2
View file @
b84fd74c
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
# Pour la prod -> system("Rscript ./dev/03_deploy.R prod")
# Pour la prod -> system("Rscript ./dev/03_deploy.R prod")
start_time
<-
Sys.time
()
start_time
<-
Sys.time
()
cat
(
paste0
(
"Debut du déploiement : "
,
start_time
))
cat
(
paste0
(
"Debut du déploiement : "
,
start_time
,
"\n"
))
# Récuperer les arguments passer en ligne de commande (prod ou preprod)
# Récuperer les arguments passer en ligne de commande (prod ou preprod)
args
=
commandArgs
(
trailingOnly
=
T
)
args
=
commandArgs
(
trailingOnly
=
T
)
...
@@ -87,5 +87,4 @@ rsconnect::deployApp(
...
@@ -87,5 +87,4 @@ rsconnect::deployApp(
end_time
<-
Sys.time
()
end_time
<-
Sys.time
()
success_msg
(
"Déploiement terminé avec succès !"
)
print
(
paste0
(
"Fin de déploiement : "
,
end_time
))
print
(
paste0
(
"Fin de déploiement : "
,
end_time
))
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