TigerFetch.jl

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

commit c5a5c8172b0f1905f7754468bbe2e229e08da6e9
parent 929ea1b79dec40023767fa9d5ef3453490f483c8
Author: Erik Loualiche <eloualic@umn.edu>
Date:   Sun, 23 Feb 2025 18:35:03 -0600

some cleaning up of the readme

Diffstat:
MREADME.md | 37++++++++++++++++++++++++++++++++-----
Mdeps/build.jl | 17+++++++++++++++--
Msrc/TigerFetch.jl | 3++-
3 files changed, 49 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md @@ -1,17 +1,44 @@ # TigerFetch +## Installation + +#### Command line tool Install the command line tool (you need a julia installation for this) ```bash +mkdir -p /.local/share/julia # or some other directory +git clone git@github.com:eloualiche/TigerFetch.jl.git ~/.local/share/julia julia --project deps/build.jl install ``` -The binary will available at `~/.julia/bin/tigerfetch`. +The binary will available at `~/.julia/bin/tigerfetch` but also depends on the downloaded packages. +An easier way is to install the package directly from julia. + +#### Julia package + +TigerFetch.jl is not yet a registered package. +You can install it from github via +```julia +import Pkg +Pkg.add(url="https://github.com/eloualiche/TigerFetch.jl") +``` + +Then install the cli tool with +```julia +using TigerFetch; TigerFetch.comonicon_install() +```` + + + +## Usage + +#### Command line tool + You can use it ```bash ~/.julia/bin/tigerfetch --help -~/.julia/bin/tigerfetch state -~/.julia/bin/tigerfetch cousub --state IL -~/.julia/bin/tigerfetch areawater --state "Minnesota" # 10,000 lakes -~/.julia/bin/tigerfetch areawater --state "Minnesota" --county "Hennepin" +~/.julia/bin/tigerfetch state --output tmp +~/.julia/bin/tigerfetch cousub --state IL --output tmp +~/.julia/bin/tigerfetch areawater --state "Minnesota" --output tmp # does not work # 10,000 lakes +~/.julia/bin/tigerfetch areawater --state "Minnesota" --county "Hennepin" --output tmp # works ``` diff --git a/deps/build.jl b/deps/build.jl @@ -1,2 +1,14 @@ -# build.jl -using TigerFetch; TigerFetch.comonicon_install() +#!/usr/bin/env julia + +# Get the project directory +project_dir = dirname(dirname(@__FILE__)) +@info project_dir + +# Activate and instantiate the project +import Pkg +Pkg.activate(project_dir) +Pkg.instantiate() + +# Now we can safely use the package +using TigerFetch +TigerFetch.comonicon_install()+ \ No newline at end of file diff --git a/src/TigerFetch.jl b/src/TigerFetch.jl @@ -23,7 +23,8 @@ include("cli.jl") # Export types # export download_shapefile # this actually relies on internal types ... that we might not want to export # Export CLI function -export tigerfetch # the julia function +export tigerdownload # the julia function +# export tigerfetch # the cli function # --------------------------------------------------------------------------------------------------