Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,4 @@ docs/
/reports/il_lea/data_clean
*.RData
pkg.lock
reports/il_npa/utils/peoplesgas_projects_20251117.geojson
33 changes: 27 additions & 6 deletions reports/il_npa/Justfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
all: clean render
all: prep-data clean render


# Fetch and create raw geo data files - you should not need to run this unless the files are missing from S3
# Fetch People's Gas project data from ArcGIS (downloads to utils/)
fetch-data:
uv run python utils/download_peoplesgas_data.py
Expand All @@ -19,7 +21,7 @@ fetch-streets:

fetch-city-blocks:
mkdir -p data/geo_data/city_blocks
aws s3 cp s3://data.sb.east/gis/pgl/pgp_blocks.geojson \
aws s3 cp s3://data.sb/il_npa/gis/pgl/pgp_blocks.geojson \
data/geo_data/city_blocks/pgp_blocks.geojson


Expand All @@ -31,14 +33,33 @@ fetch-all-data:
uv run python utils/download_chicago_streets.py
just fetch-city-blocks

# Explore available feature categories and statistics
explore-data:
uv run python utils/explore_features.py

# Upload GeoJSON to public S3 bucket (s3://data.sb.east/gis/pgl/)
# Upload raw GeoJSON to public S3 bucket (s3://data.sb/il_npa/gis/pgl/)
upload-data:
uv run python utils/upload_to_s3.py


# Run preprocessing scripts only if output files don't exist. These files are read in by geo_data_cleaning.qmd
prep-data:
#!/usr/bin/env bash
set -euo pipefail

# Step 1: Clean polygons
if [ ! -f data/outputs/peoples_polygons_unioned.geojson ]; then
echo "🔄 Running clean_peoples_construction_polygons.py..."
uv run python notebooks/clean_peoples_construction_polygons.py
else
echo "✓ peoples_polygons_unioned.geojson exists, skipping"
fi

# Step 2: Match parcels with buildings
if ! ls data/outputs/parcels_with_units_*.geojson 1> /dev/null 2>&1; then
echo "🔄 Running match_parcels_buildings.py..."
uv run python notebooks/match_parcels_buildings.py
else
echo "✓ parcels_with_units file exists, skipping"
fi

# Delete all caches
clean:
rm -rf .quarto docs/*_files/ notebooks/*_files/ notebooks/*.html \
Expand Down
1 change: 1 addition & 0 deletions reports/il_npa/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ project:
type: manuscript
output-dir: docs
render:
- notebooks/geo_data_cleaning.qmd
- notebooks/analysis.qmd
- index.qmd

Expand Down
252 changes: 251 additions & 1 deletion reports/il_npa/index.qmd

Large diffs are not rendered by default.

Loading