This repository was archived by the owner on Jun 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathremake.yml
56 lines (47 loc) · 1.89 KB
/
remake.yml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
packages:
- tidyverse
- meddle # at least v0.0.12
- scipiper
- readr
- sbtools
- sf
- yaml
sources:
- src/sb_utils.R
- src/file_utils.R
targets:
all:
depends:
- log/sb_posted_files.csv
# create target of spatial file
# please note that the extract_feature function (below) from the meddle package must be run to create certain pieces of spatial metadata
# if you are not uploading any spatial data files to your data release,
# you will need to find a shapefile that represents the geographic area or your data release
# upload this file to your pipeline repostiory, read it in with the read_spatial_file function below, and extract_feature will pull the necessary metadata
# you do NOT need to upload this file to ScienceBase with the sf_to_zip function if it was not a planned part of your data release
sf_spatial_data:
command: st_read('example_data/example_shapefile/example_shapefile.shp')
depends:
- example_data/example_shapefile/example_shapefile.dbf
- example_data/example_shapefile/example_shapefile.prj
- example_data/example_shapefile/example_shapefile.shx
# grab metadata from spatial file
spatial_metadata:
command: meddle::extract_feature(sf_spatial_data)
out_data/cars.csv:
command: file.copy(from = "example_data/example_cars.csv",
to = target_name, overwrite = TRUE)
out_data/spatial.zip:
command: sf_to_zip(zip_filename = target_name,
sf_object = sf_spatial_data, layer_name = I('spatial_data'))
out_xml/fgdc_metadata.xml:
command: render(filename = target_name,
"in_text/text_data_release.yml",
spatial_metadata)
log/sb_posted_files.csv:
command: sb_replace_files_log(filename = target_name,
sb_id = I('5faaac68d34eb413d5df1f22'),
"out_data/spatial.zip",
"out_data/cars.csv",
"out_xml/fgdc_metadata.xml",
sources = "src/sb_utils.R")