-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare_gis.R
36 lines (27 loc) · 1.03 KB
/
prepare_gis.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -------------------------------------
# Script: prepare_gis.R
# Author: Michal Kvasnička
# Purpose: This script exports the clusters for the use in GIS software.
# Inputs: accidents, clusters, profiles, and log file
# Outputs: GIS files
#
# Copyright(c) Corporation Name
# -------------------------------------
# TEMP: remove
# supply path to RSCRIPTDIR if it was not supplied outside
if (!exists("RSCRIPTDIR")) RSCRIPTDIR <- "."
# supply path to folder where user stores her config and profile
if (!exists("DIR_ORIGIN")) DIR_ORIGIN <- "data"
# source necessary scripts
source(file.path(RSCRIPTDIR, "functions_auxiliary.R"))
source(file.path(RSCRIPTDIR, "functions_gis_preparation.R"))
# process command-line parameters
# read user config/profiles
profiles <- read_profiles()
# read in districts
districts <- read_districts()
# write GIS shape file; this doesn't update but it rewrites existing files
write_gis_files(districts,
gis_dir = gis_dir(),
shiny_dir = shiny_dir(),
profiles)