Add MN crop history by county layer

This commit is contained in:
Chandler Swift 2024-11-11 23:04:36 -06:00
parent 5859795b3e
commit 6e28990290
Signed by: chandlerswift
GPG key ID: A851D929D52FB93F
5 changed files with 191 additions and 0 deletions

17
layers/crop-history/get_data.sh Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash --pure
#! nix-shell -p bash wget unzip python3 python3Packages.geopandas python3Packages.fiona python3Packages.pyproj
# TODO: do I need all the python packages?
set -x -euo pipefail
wget -nc https://www.nass.usda.gov/Research_and_Science/Crop-Sequence-Boundaries/datasets/NationalCSB_2016-2023_rev23.zip
wget -nc https://www2.census.gov/geo/docs/reference/codes2020/national_cousub2020.txt
unzip -u NationalCSB_2016-2023_rev23.zip
mkdir -p data
# HEADS UP: this script takes something like 40GB of RAM. In theory, I could
# probably do something clever with streaming...but I have 40 GB of RAM, so this
# works!
python -i extract_counties.py NationalCSB_2016-2023_rev23/CSB1623.gdb