-
Notifications
You must be signed in to change notification settings - Fork 1
[FEATURE] Add Downloading Abilities #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| """ | ||
| Base URL for TIGER/Line data with two parameters for year and layer. | ||
| """ | ||
| BASE_TIGER_URL = FormatExpr("https://www2.census.gov/geo/tiger/TIGER{}/{}/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be const
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But maybe it could be a function?
base_tiger_url(year, layer) = "https://www2.census.gov/geo/tiger/TIGER$(year)/$(layer)/"which would neatly remove the Format.jl dependency as well.
| for f in files | ||
| @info "Downloading $f for layer, \"$(TIGER_DICT[layer])\", and year, $year." | ||
| download( | ||
| joinpath(url, f), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will likely be incorrect on windows (backslash)
|
|
||
| ## Keys | ||
|
|
||
| - `"address_range_rel"` (**ADDR**) - Address Range Relationship File |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are the three different things here? julia name, tiger name, description? We should describe this explicitly
| # "https://www2.census.gov/geo/tiger/GENZ2018/shp/cb_2018_us_state_5m.zip" | ||
|
|
||
| """ | ||
| A dictionary mapping human-readable keys to TIGER/Line dataset codes and their associated descriptions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not quite true as of now? There seem to be no descriptions
| ) | ||
| ``` | ||
| Downloads TIGER/Line geographic data from the US Census Bureau for the specified year and geographic layer, | ||
| saving the data as shapefiles. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not quite - seems it saves as zip files? Shapefile.jl has zip support via ZipFile.jl but it's a bit dicey.
|
I made a new PR #7 with this code and some additions from my end, but can't target it to this branch. |
|
See TheCedarPrince#1 for the diff if interested, feel free to merge that there as well and I can close #7 here |
Hey @asinghvi17,
Finally, after a year in the making (more like 3 hours), we have downloading somewhat built out as a first draft for TigerLine.jl! This adds a few useful constants and one new function called
download_tiger. Here is what it covers:Not sure how to add tests to this, but otherwise, excited to get this functionality made finally!