Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgohel committed Feb 1, 2024
0 parents commit 4f3d46b
Show file tree
Hide file tree
Showing 13 changed files with 48 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.Rproj.user
.Rhistory
12 changes: 12 additions & 0 deletions data-src/ADMIN-EXPRESS-extract.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
archive_file <- tempfile(fileext = ".7z")
curl::curl_download(
url = "https://wxs.ign.fr/x02uy2aiwjo9bm8ce5plwqmr/telechargement/prepackage/ADMINEXPRESS_SHP_TERRITOIRES_PACK_2023-12-19$ADMIN-EXPRESS_3-2__SHP_LAMB93_FXX_2023-12-19/file/ADMIN-EXPRESS_3-2__SHP_LAMB93_FXX_2023-12-19.7z",
destfile = archive_file)
dest <- tempfile()
archive::archive_extract(archive_file, dir = dest)
file.rename(from = file.path(dest, "ADMIN-EXPRESS_3-2__SHP_LAMB93_FXX_2023-12-19/ADMIN-EXPRESS/1_DONNEES_LIVRAISON_2023-12-00156/ADE_3-2_SHP_LAMB93_FXX-ED2023-12-19"),
to = "data/ADE-3-2")

files <- list.files("data/ADE-3-2", full.names = TRUE)
keep <- grep("[^_](REGION|COMMUNE)\\.[a-z]{3}$", files, value = TRUE)
setdiff(files, keep) |> unlink(force = TRUE)
15 changes: 15 additions & 0 deletions data-src/CARTElette-extract.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
library(CARTElette)

dep_sf_simplifiee <- charger_carte(
nivsupra = "DEP", geometrie_simplifiee = TRUE)
saveRDS(dep_sf_simplifiee, "data/dep_sf_simplifiee.RDS")

reg_sf_simplifiee <- charger_carte(
nivsupra = "REG", geometrie_simplifiee = TRUE)
saveRDS(reg_sf_simplifiee, "data/reg_sf_simplifiee.RDS")

com_sf_plm <- charger_carte(COG = 2021, nivsupra = "COM", enlever_PLM = TRUE, geometrie_simplifiee = FALSE)
saveRDS(com_sf_plm, "data/com_sf_plm.RDS")

com_sf_noplm <- charger_carte(COG = 2021, nivsupra = "COM", enlever_PLM = FALSE, geometrie_simplifiee = FALSE)
saveRDS(com_sf_noplm, "data/com_sf_noplm.RDS")
1 change: 1 addition & 0 deletions data/ADE-3-2/REGION.cpg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UTF-8
Binary file added data/ADE-3-2/REGION.dbf
Binary file not shown.
1 change: 1 addition & 0 deletions data/ADE-3-2/REGION.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PROJCS["RGF93_Lambert_93",GEOGCS["GCS_RGF_1993",DATUM["D_RGF_1993",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",700000.0],PARAMETER["False_Northing",6600000.0],PARAMETER["Central_Meridian",3.0],PARAMETER["Standard_Parallel_1",44.0],PARAMETER["Standard_Parallel_2",49.0],PARAMETER["Latitude_Of_Origin",46.5],UNIT["Meter",1.0]]
Binary file added data/ADE-3-2/REGION.shp
Binary file not shown.
Binary file added data/ADE-3-2/REGION.shx
Binary file not shown.
Binary file added data/com_sf_noplm.RDS
Binary file not shown.
Binary file added data/com_sf_plm.RDS
Binary file not shown.
Binary file added data/dep_sf_simplifiee.RDS
Binary file not shown.
Binary file added data/reg_sf_simplifiee.RDS
Binary file not shown.
17 changes: 17 additions & 0 deletions maps-data.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Version: 1.0

RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: XeLaTeX

AutoAppendNewline: Yes
StripTrailingWhitespace: Yes
LineEndingConversion: Posix

0 comments on commit 4f3d46b

Please sign in to comment.