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  EnvVarRequirement:
30    envDef:
31      HTTP_PROXY: "$('proxy' in inputs? inputs.proxy: null)"
32      HTTPS_PROXY: "$('proxy' in inputs? inputs.proxy: null)"
33      NO_PROXY: "localhost,127.0.0.1,172.17.0.1"
34
35
36doc: |
37  This tool downloads Shape files from a given collection (TIGER/Line or GENZ) 
38  and a geography (ZCTA or Counties) from the US Census website,
39  for a given year or for the closest one.
40
41inputs:
42  proxy:
43    type: string?
44    default: ""
45    doc: HTTP/HTTPS Proxy if required
46  year:
47    type: string
48    doc: Calendar year, for which we are downloading shape file
49    inputBinding:
50      prefix: --year
51  geo:
52    type: string
53    doc: geography type, zip, zcta or county
54    inputBinding:
55      prefix: --geography
56  collection:
57    type: string
58    default: tiger
59    doc: |
60      [Collection of shapefiles](https://www2.census.gov/geo/tiger), 
61      either GENZ or TIGER
62    inputBinding:
63      prefix: --collection
64
65outputs:
66  shape_files:
67    type: File[]
68    outputBinding:
69      glob: "*.shp"
70    secondaryFiles:
71      - "^.dbf"
72      - "^.shx"
73      - "^.prj"
74      - "^.cpg"