TigerFetch.jl

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

README.md (3097B)


      1 # TigerFetch
      2 
      3 This package downloads TIGER/Line shapefiles from the US Census Bureau FTP server.
      4 
      5 This was written for personal use and to learn about julia's capabilities to generate cli tools.
      6 Thus the package is fairly lean and does not convert shapefiles into dataframes or GeoJSON.
      7 The package has only been tested for the 2024 files, but could be extended to accomodate other vintages.
      8 For serious use, you'd probably be better off using [tigris](https://github.com/walkerke/tigris)
      9 
     10 What the package does is provide a convenient interface to pull file from the Census. 
     11 You can always check what is directly available on the [ftp server.](https://www2.census.gov/geo/tiger)
     12 
     13 
     14 
     15 ## Installation
     16 
     17 You can either use the package through the command line (and stay away from julia) or you can use it from within julia.
     18 
     19 
     20 #### Command line tool
     21 Install the command line tool (you need a julia installation for this)
     22 ```bash
     23 mkdir -p /.local/share/julia # or some other directory 
     24 git clone git@github.com:louloulibs/TigerFetch.jl.git  ~/.local/share/julia
     25 cd ~/.local/share/julia  && julia --project deps/build.jl install
     26 ```
     27 
     28 The binary will available at `~/.julia/bin/tigerfetch` but also depends on the downloaded packages.
     29 An easier way is to install the package directly from julia. 
     30 
     31 #### Julia package
     32 
     33 
     34 `TigerFetch.jl` is a registered package. 
     35 You can install from the my julia registry [`loulouJL`](https://github.com/LouLouLibs/loulouJL) via the julia package manager:
     36 ```julia
     37 > using Pkg, LocalRegistry
     38 > pkg"registry add https://github.com/LouLouLibs/loulouJL.git"
     39 > Pkg.add("TigerFetch")
     40 ```
     41 
     42 If you don't want to add a new registry, you can install it directly from github:
     43 ```julia
     44 > import Pkg; Pkg.add("https://github.com/louloulibs/TigerFetch.jl#main")
     45 ```
     46 
     47 
     48 Then install the cli tool with
     49 ```julia
     50 using TigerFetch; TigerFetch.comonicon_install()
     51 ````
     52 
     53 
     54 
     55 ## Usage
     56 
     57 #### Command line tool
     58 
     59 You can use it 
     60 ```bash
     61 ~/.julia/bin/tigerfetch --help
     62 ~/.julia/bin/tigerfetch state --output tmp
     63 ~/.julia/bin/tigerfetch cousub --state IL --output tmp 
     64 ~/.julia/bin/tigerfetch areawater --state "Minnesota" --output tmp # 10,000 lakes
     65 ~/.julia/bin/tigerfetch areawater --state "MN" --county "Hennepin" --output tmp 
     66 ```
     67 
     68 
     69 #### Julia package
     70 
     71 Look at the [doc](https://louloulibs.github.io/TigerFetch.jl/dev/) or at the test suite (specifically `UnitTests/downloads.jl`).
     72 
     73 This [issue](#4) tracks which geographies have been implemented thus far. 
     74 
     75 
     76 
     77 
     78 [![CI](https://github.com/louloulibs/TigerFetch.jl/actions/workflows/CI.yml/badge.svg)](https://github.com/louloulibs/TigerFetch.jl/actions/workflows/CI.yml)
     79 [![Lifecycle:Experimental](https://img.shields.io/badge/Lifecycle-Experimental-339999)](https://github.com/louloulibs/Prototypes.jl/actions/workflows/CI.yml)
     80 [![codecov](https://codecov.io/gh/louloulibs/TigerFetch.jl/graph/badge.svg?token=OZRTOQU9H6)](https://codecov.io/gh/louloulibs/TigerFetch.jl)
     81 
     82 [![][docs-latest-img]][docs-latest-url]
     83 
     84 
     85 
     86 [docs-latest-img]: https://img.shields.io/badge/docs-latest-blue.svg
     87 [docs-latest-url]: https://louloulibs.github.io/TigerFetch.jl/