get_shapes.cwl

 1#!/usr/bin/env cwl-runner
 2### Downloads Shape files from US Census website for a given year or the closest one
 3#  Copyright (c) 2021. Harvard University
 4#
 5#  Developed by Research Software Engineering,
 6#  Faculty of Arts and Sciences, Research Computing (FAS RC)
 7#  Author: Quantori LLC
 8#
 9#  Licensed under the Apache License, Version 2.0 (the "License");
10#  you may not use this file except in compliance with the License.
11#  You may obtain a copy of the License at
12#
13#         http://www.apache.org/licenses/LICENSE-2.0
14#
15#  Unless required by applicable law or agreed to in writing, software
16#  distributed under the License is distributed on an "AS IS" BASIS,
17#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18#  See the License for the specific language governing permissions and
19#  limitations under the License.
20#
21
22cwlVersion: v1.2
23class: CommandLineTool
24baseCommand: [python, -m, dorieh.gis.shapes_downloader]
25
26requirements:
27  ResourceRequirement:
28    coresMin: 1
29  NetworkAccess:
30    networkAccess: True
31  EnvVarRequirement:
32    envDef:
33      HTTP_PROXY: "$('proxy' in inputs? inputs.proxy: null)"
34      HTTPS_PROXY: "$('proxy' in inputs? inputs.proxy: null)"
35      NO_PROXY: "localhost,127.0.0.1,172.17.0.1"
36
37
38doc: |
39  This tool downloads Shape files from a given collection (TIGER/Line or GENZ) 
40  and a geography (ZCTA or Counties) from the US Census website,
41  for a given year or for the closest one.
42
43inputs:
44  proxy:
45    type: string?
46    default: ""
47    doc: HTTP/HTTPS Proxy if required
48  year:
49    type: string
50    doc: Calendar year, for which we are downloading shape file
51    inputBinding:
52      prefix: --year
53  geo:
54    type: string
55    doc: geography type, zip, zcta or county
56    inputBinding:
57      prefix: --geography
58  collection:
59    type: string
60    default: tiger
61    doc: |
62      [Collection of shapefiles](https://www2.census.gov/geo/tiger), 
63      either GENZ or TIGER
64    inputBinding:
65      prefix: --collection
66
67outputs:
68  shape_files:
69    type: File[]
70    outputBinding:
71      glob: "*.shp"
72    secondaryFiles:
73      - "^.dbf"
74      - "^.shx"
75      - "^.prj"
76      - "^.cpg"