forked from USGS-R/hierarchical-data-release-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1_spatial.yml
36 lines (31 loc) · 1.33 KB
/
1_spatial.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
packages:
- dplyr
- meddle
- rgdal
- sf
- zip
sources:
- src/spatial_functions.R
- src/fetch_filter_functions.R
- src/file_functions.R
targets:
1_spatial:
depends:
- out_data/XX_geospatial_area_WG84.zip
- geospatial_area_metadata
# 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
geospatial_area_WG84:
command: read_spatial_file(path = 'in_data/example_data/drb_shp/physiographic_regions_DRB.shp', selected_crs = 4326)
# grab metadata from spatial file
geospatial_area_metadata:
command: meddle::extract_feature(geospatial_area_WG84)
# Output geospatial area shp
out_data/XX_geospatial_area_WG84.zip:
command: sf_to_zip(target_name,
sf_object = geospatial_area_WG84,
layer_name = I('geospatial_area_WG84'))