--- license: cc-by-4.0 language: - en tags: - geospatial - cafo - dairy - wisconsin - environmental - permits - remote-sensing - agriculture - farm pretty_name: Wisconsin Large Dairy Farms Dataset (CAFOs) size_categories: - 1G1000 AU)"` (estimated >1000 AU, no permit match — above the threshold requiring a CAFO permit in Wisconsin). | | `permit_facility_id` | float | WDNR permit data | Wisconsin DNR Facility Identification Number (FIN) for facilities matched to a CAFO permit within 500m. `NaN` for unmatched facilities. Source: `WDNR_CAFOs.geojson`. | | `permit_allowable_animal_units` | float | WDNR permit data | Maximum animal units allowed under the facility's CAFO permit. `NaN` for unmatched facilities. Source: `WDNR_CAFOs.geojson`. | | `matched_milk` | bool | WI DATCP milk producer licenses | Whether the facility was spatially matched (within 500m) to an active Wisconsin milk producer license. Source: `milk_producers.geojson`. | | `type_of_milk` | string | WI DATCP milk producer licenses | Type of milk produced at the matched milk license (`"Bovine"`, `"Goat"`, etc.). `None` if `matched_milk` is False. Source: `milk_producers.geojson`. | | `water_distance` | float | WI DNR hydrography | Distance (m) from the facility centroid to the nearest surface water body (open water, perennial or intermittent stream). | | `impaired_water_distance` | float | EPA 303(d) / WI DNR | Distance (m) to the nearest EPA 303(d)-listed impaired water body or stream. | | `closest_water_impaired` | bool | EPA 303(d) / WI DNR | `True` if the nearest water body is 303(d)-listed impaired (i.e., `impaired_water_distance` ≤ `water_distance`). | | `hydro_intermit_distance` | float | WI DNR 24K hydrography | Distance (m) to the nearest intermittent stream. | | `hydro_perennial_distance` | float | WI DNR 24K hydrography | Distance (m) to the nearest perennial stream. | | `gw_0` | bool | WI DNR groundwater | `True` if the facility is located in an area with a water table depth of 0 ft (i.e., at or above the surface). Source: GCSM water table depth layer. | | `gw_20` | bool | WI DNR groundwater | `True` if the facility is in an area with water table depth ≤ 20 ft. | | `gw_50` | bool | WI DNR groundwater | `True` if the facility is in an area with water table depth ≤ 50 ft. | | `bedrock_lt5ft_distance` | float | SNAPMAPs | Distance (m) to the nearest area with bedrock depth < 5 ft (shallow bedrock). Source: SNAPMAPs soils layer. | | `bedrock_lt5ft_dummy` | bool | SNAPMAPs | `True` if the facility itself is located on shallow bedrock (depth < 5 ft). | | `silurian_0_2_distance` | float | SNAPMAPs | Distance (m) to the nearest area with Silurian carbonate bedrock at 0–2 ft depth. | | `silurian_0_2_dummy` | bool | SNAPMAPs | `True` if the facility sits on Silurian carbonate bedrock at 0–2 ft. | | `silurian_2_5_distance` | float | SNAPMAPs | Distance (m) to the nearest area with Silurian carbonate bedrock at 2–5 ft depth. | | `silurian_2_5_dummy` | bool | SNAPMAPs | `True` if the facility sits on Silurian carbonate bedrock at 2–5 ft. | | `shallow_silurian_distance` | float | SNAPMAPs | Distance (m) to the nearest area with any shallow Silurian carbonate bedrock (0–5 ft). | | `shallow_silurian_dummy` | bool | SNAPMAPs | `True` if the facility sits on any shallow Silurian carbonate bedrock (0–5 ft). | | `mean_slope` | float | WI DNR 30m DEM | Mean terrain slope (%) within a 1 km radius of the facility centroid, derived from a 30m digital elevation model. | | `slope_greater_12_distance` | float | WI DNR 30m DEM | Distance (m) to the nearest area with slope > 12%. | | `slope_greater_12_dummy` | bool | WI DNR 30m DEM | `True` if the facility is located in an area with slope > 12%. | | `swqma_300ft_distance` | float | SNAPMAPs | Distance (m) to the nearest Surface Water Quality Management Area (SWQMA) 300 ft buffer zone — a regulatory setback for manure spreading. | | `swqma_300ft_dummy` | bool | SNAPMAPs | `True` if the facility is within a SWQMA 300 ft zone. | | `swqma_1000ft_distance` | float | SNAPMAPs | Distance (m) to the nearest SWQMA 1,000 ft buffer zone. | | `swqma_1000ft_dummy` | bool | SNAPMAPs | `True` if the facility is within a SWQMA 1,000 ft zone. | | `cafo_w_restrict_distance` | float | SNAPMAPs | Distance (m) to the nearest winter-restricted spreading zone for CAFOs (areas where manure spreading is prohibited in winter). | | `cafo_r_restrict_distance` | float | SNAPMAPs | Distance (m) to the nearest CAFO regulatory restriction area (general CAFO-specific spreading restriction zone). | | `hand_built_risk_index` | float | Constructed | Composite environmental risk index (0–1) built by manually weighting proximity to impaired waters, groundwater depth, bedrock depth, and regulatory restriction zones. Higher = greater environmental risk. | | `pca_risk_index` | float | Constructed | Composite environmental risk index (0–1) derived from principal component analysis of the same geospatial risk factors used in `hand_built_risk_index`. Higher = greater environmental risk. | | `n_buildings` | int | Constructed | Number of individual barn polygons that make up this facility cluster. | | `n_parcels` | int | Constructed | Number of distinct land parcels associated with this facility cluster (via spatial join to WI statewide parcel data). | | `cluster_area_m2` | float | Constructed | Total footprint area of all barn polygons in the facility cluster, in square meters. | | `geometry` | geometry | Constructed | MultiPolygon of all human-annotated barn footprints comprising the facility, in WGS84 (EPSG:4326) for GeoJSON/CSV and WI State Plane (EPSG:3071) for Parquet. | ### Quick Start ```python import geopandas as gpd # Load from local file gdf = gpd.read_file("wi_cafo_facilities.geojson") # Or load from Hugging Face Hub from huggingface_hub import hf_hub_download path = hf_hub_download( repo_id="reglab/wisconsin-dairy-cafo", filename="wi_cafo_facilities.geojson", repo_type="dataset" ) gdf = gpd.read_file(path) ``` --- ## Input Data (`input_data/`) These are the raw and intermediate datasets used to generate the publication dataset and all paper figures. Download this folder and follow the setup instructions at [this GitHub repository](https://github.com/reglab/wi-cafo-analysis) to reproduce all results. ### `input_data/annotations/` Human-labeled barn polygon annotations produced by CloudFactory workers on NAIP aerial imagery. | File | Description | |---|---| | `full_state_cf_annotations.geojson` | All human-annotated polygon annotations outside the 9-county EWG study region. | | `ewg_region_train_labels.geojson` | All human-annotated polygon annotations within the 9-county EWG study region (Brown, Calumet, Fond du Lac, Green Lake, Manitowoc, Outagamie, Sheboygan, Waupaca, Winnebago). | --- ### `input_data/WDNR_CAFOs.geojson` **Source:** Wisconsin Department of Natural Resources (WDNR) **Acquired:** 2022-01-25 Locations and full permit metadata for all CAFO sites permitted by WDNR in Wisconsin. This is a full join of CAFO main permit sites (2018 database) and satellite sites (2022 geocoded permits). --- ### `input_data/ewg_AFOs_012022.geojson` **Source:** Environmental Working Group (EWG) **Acquired:** January 2022 Point locations and metadata for all Animal Feeding Operations (AFOs) labeled by EWG across Wisconsin. See description and methodology [here](https://www.ewg.org/research/double-trouble-wisconsins-land-and-water-are-inundated-pollution-animal-manure-and-excess) --- ### `input_data/permit_animal_type_records.csv` **Source:** WDNR permit website (manual compilation) **Date:** 2025-05-14 Animal type counts manually compiled from WDNR CAFO permit application PDF documents. Each row corresponds to one permitted facility and contains counts of each animal type on-site (dairy cows, heifers, calves, dry cows, swine, poultry, etc.). Sourced from the WDNR e-permitting portal website [here](https://dnr.wisconsin.gov/permits/water). **Key columns:** - Facility identifiers linking to `WDNR_CAFOs.geojson` via FIN - Per-animal-type counts (dairy cows, heifers, calves, dry cows, beef, swine, poultry) --- ### `input_data/milk_producers.geojson` **Source:** Wisconsin Department of Agriculture, Trade and Consumer Protection (DATCP) **Acquired:** 2023-07-01, updated 2024-03-04 **URL:** [DATCP Milk Producer Licenses](https://mydatcp.wi.gov/SiteMap/ServiceDetails/60670424-cf8c-eb11-8141-0050568c4f26) All active permitted milk producer licenses in Wisconsin, geocoded to coordinate points using the Google Geocoding API. 75 instances of inaccurate geocoding were identified and manually corrected in the March 2024 update. --- ### `input_data/clusters/` Facility-level clusters: groups of overlapping/adjacent model-predicted barn polygons (or human-annotated polygons) merged into single facility records using the clustering algorithm in `cluster.py`. All model clusters use confidence threshold 0.5 unless otherwise noted. | File | Size | Description | |---|---|---| | `all_cf_clusters.geojson` | ~14 MB | Facility clusters derived from all CloudFactory human annotations statewide. Includes cluster geometries. | | `four_band_clusters.csv` | ~224 MB | Facility clusters from the 4-band (RGB + near-infrared) segmentation model, run at full state coverage. | | `three_band_clusters.csv` | ~180 MB | Facility clusters from the 3-band (RGB only) segmentation model, run at full state coverage. | --- ### `input_data/geospatial/` Ancillary geospatial layers used in environmental risk assessment. #### `geospatial/county_boundaries/` Wisconsin county boundary shapefiles at 1:24,000 scale. **Source:** WDNR Open Data Portal #### `geospatial/water_data/` | File | Source | Description | |---|---|---| | `GCSM_-_Water_Table_Depth.geojson` | [WI DNR](https://data-wi-dnr.opendata.arcgis.com/datasets/wi-dnr::gcsm-water-table-depth/about) | Depth to groundwater table (m) across Wisconsin | | `impaired_rivers_streams.geojson` | [EPA 303(d) / WI DNR](https://data-wi-dnr.opendata.arcgis.com/search?q=303&tags=water) | Rivers and streams listed as impaired under the Clean Water Act | | `impaired_lakes.geojson` | [EPA 303(d) / WI DNR](https://data-wi-dnr.opendata.arcgis.com/search?q=303&tags=water) | Lakes listed as impaired under the Clean Water Act | | `24k_Hydro_Waterbodies_(Open_Water).geojson` | [WI DNR](https://data-wi-dnr.opendata.arcgis.com/datasets/wi-dnr::24k-hydro-waterbodies-open-water) | All open water bodies in Wisconsin (24K hydrography) | --- ## Not Included (Available from Original Sources) These large datasets are used in the analysis pipeline but are not included here. Download them from the original sources and set paths in `config/config.yml` per the [analysis repo README](https://github.com/reglab/wi-cafo-analysis). | Dataset | Source | Notes | |---|---|---| | Wisconsin land parcels (V8.0.0) | [WI SCO Parcel Data](https://www.sco.wisc.edu/parcels/data/) | Full statewide parcel polygons; used for ownership matching and clustering of individual barn polygons into farms | | 30m Digital Elevation Model | [WI DNR / geodata.wisc.edu](https://geodata.wisc.edu/catalog/WIDNR-b131bd2b397f467499575afa5c22f994) | Used to compute mean slope within 1km radius of each facility | | Wisconsin urban areas (TIGER 2020) | [U.S. Census TIGER](https://www.census.gov/geographies/mapping-files/time-series/geo/tiger-line-file.html) | Used to filter model predictions to exclude urban areas | | SNAPMAPs nutrient management layers | [DATCP GIS Data](https://datcp.wi.gov/Pages/Programs_Services/GISData.aspx) | Policy-relevant soils, waterways, slope, and regulatory restriction layers used in risk assessment | | USDA NAIP aerial imagery | [NAIP Hub](https://naip-usdaonline.hub.arcgis.com/) | Used for model training and inference. --- ## Reproducing the Paper 1. Clone [reglab/wi-cafo-analysis](https://github.com/reglab/wi-cafo-analysis) and follow its README to set up the Python environment. 2. Download `input_data/` from this repository and place it at the paths specified in `config/config.yml`. 3. Download the "Not Included" datasets above from their original sources. 4. Run: ```bash python generate_paper_results.py --skip-imagery # omit --skip-imagery if you have GCP access ``` 5. All paper figures and tables will be written to `paper_results/`. --- ## License This dataset is released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). You are free to share and adapt for any purpose with attribution. Source data (WDNR permits, EWG AFOs, DATCP milk licenses, WI DNR hydrography) are from public government sources. --- ## Citation *Citation to be added upon publication.* --- ## Contact RegLab, Stanford Law School — [reglab.stanford.edu](https://reglab.stanford.edu)