TigerFetch.jl

Download TIGER/Line shapefiles from the US Census Bureau
Log | Files | Refs | README | LICENSE

cli.md (2706B)


      1 # Command line interface
      2 
      3 TigerFetch provides a `tigerfetch` command that downloads TIGER/Line shapefiles directly from your terminal.
      4 
      5 ## Installation
      6 
      7 You need a working Julia installation. Then install the CLI:
      8 
      9 ```bash
     10 julia -e 'using Pkg; Pkg.add("TigerFetch"); using TigerFetch; TigerFetch.comonicon_install()'
     11 ```
     12 
     13 The binary is placed at `~/.julia/bin/tigerfetch`. Make sure `~/.julia/bin` is on your `PATH`.
     14 
     15 ## Usage
     16 
     17 ```bash
     18 tigerfetch <type> [year] [--state STATE] [--county COUNTY] [--output DIR] [--force]
     19 ```
     20 
     21 ### Arguments
     22 
     23 | Argument | Description | Default |
     24 |----------|-------------|---------|
     25 | `type` | Geography type (see table below) | required |
     26 | `year` | Data year | 2024 |
     27 
     28 ### Options
     29 
     30 | Option | Description | Default |
     31 |--------|-------------|---------|
     32 | `--state` | State name, abbreviation, or FIPS code | all states |
     33 | `--county` | County name or FIPS code (requires `--state`) | all counties |
     34 | `--output` | Output directory | current directory |
     35 | `--force` | Re-download existing files | false |
     36 
     37 ### Geography types
     38 
     39 | Type | Scope | Description |
     40 |------|-------|-------------|
     41 | `state` | national | State boundaries |
     42 | `county` | national | County boundaries |
     43 | `cbsa` | national | Core Based Statistical Areas |
     44 | `urbanarea` | national | Urban Areas |
     45 | `zipcode` | national | ZIP Code Tabulation Areas |
     46 | `metrodivision` | national | Metropolitan Divisions |
     47 | `primaryroads` | national | Primary roads |
     48 | `rails` | national | Railroads |
     49 | `cousub` | state | County subdivisions |
     50 | `tract` | state | Census tracts |
     51 | `place` | state | Places |
     52 | `consolidatedcity` | state | Consolidated cities |
     53 | `primarysecondaryroads` | state | Primary and secondary roads |
     54 | `areawater` | county | Area hydrography |
     55 | `linearwater` | county | Linear hydrography |
     56 | `road` | county | Roads |
     57 
     58 ### Examples
     59 
     60 ```bash
     61 # Download state boundaries
     62 tigerfetch state --output tmp
     63 
     64 # Download county subdivisions for Illinois
     65 tigerfetch cousub --state IL --output tmp
     66 
     67 # Download area water for all of Minnesota
     68 tigerfetch areawater --state "Minnesota" --output tmp
     69 
     70 # Download roads for a single county
     71 tigerfetch road --state "MN" --county "Hennepin" --output tmp
     72 
     73 # Force re-download of 2023 data
     74 tigerfetch county 2023 --output tmp --force
     75 ```
     76 
     77 ### Scope behavior
     78 
     79 - **National** types (`state`, `county`, etc.) download a single file covering the entire US. The `--state` and `--county` flags are ignored.
     80 - **State** types (`cousub`, `tract`, etc.) download one file per state. Omitting `--state` downloads all states.
     81 - **County** types (`areawater`, `road`, etc.) download one file per county. Omitting `--county` downloads all counties for the given state(s).