The result
Spatially matched 2,116 public schools against 72 county polygons and explored nearest-school questions.
Spatial answers over 2,116 schools and 72 counties
Academic project
Matched 2,116 Wisconsin schools to 72 county polygons through a dependency-managed Cloud Storage, Dataform and BigQuery pipeline.
From the repository
A cloud data pipeline on Google Cloud. Records for every Wisconsin school land in Cloud Storage as Parquet. A Dataform pipeline loads them into BigQuery and joins them with public U.S. county boundaries. BigQuery GIS queries then answer location questions, such as which high school is closest to each middle school.
flowchart LR
P[wi-schools-raw.parquet] -->|upload| GCS[(Cloud Storage bucket)]
GCS -->|LOAD DATA| S[schools<br/><i>operation</i>]
PUB[(bigquery-public-data<br/>geo_us_boundaries.counties)] --> C[wi_counties<br/><i>table</i>]
S --> J[wi_county_schools<br/><i>table · ST_CONTAINS</i>]
C --> J
J --> BQ[BigQuery GIS<br/>analysis queries]
The notebook runs on a GCP VM. It uploads the SQLX definitions to a Dataform workspace through the Dataform API, compiles the pipeline, reads back the action dependency graph, and queries the resulting tables with the BigQuery client.
| Action | Type | What it does |
|---|---|---|
schools | operation | LOAD DATA OVERWRITE from the Parquet file in GCS |
wi_counties | table | Wisconsin (FIPS 55) county polygons from BigQuery public data |
wi_county_schools | table | Builds ST_GEOGPOINT from each school's lat/long and assigns its county with ST_CONTAINS |
| Question | Technique | Result |
|---|---|---|
| How many Wisconsin counties are there? | row count on wi_counties | 72 |
| How many public schools were matched to a county? | spatial join | 2,116 |
| Which counties have ≥ 2 cities with ≥ 3 public high schools? | BigQuery pipe syntax (|>), two-level aggregation | Brown, Dane, Milwaukee, Waukesha |
| How many runs of that query fit in 1 TiB scanned? | job.total_bytes_processed | ~6.8 million |
| Closest public high school to each Dane County middle school | ST_DISTANCE + MIN_BY over a cross join | e.g. Badger Ridge Middle → Verona Area High |
Google Cloud Storage · Dataform (SQLX) · BigQuery · BigQuery GIS · Compute Engine VM · Python (google-cloud-bigquery, google-cloud-dataform, PyArrow, pandas) · Jupyter
GCP-BigQuery-Geospatial-Pipeline/
├── wi_schools_pipeline.ipynb # upload → compile → query
├── definitions/ # Dataform SQLX actions (templated)
│ ├── schools.sqlx
│ ├── wi_counties.sqlx
│ └── wi_county_schools.sqlx
├── data/wi-schools-raw.parquet # raw school records
├── config.example.json # copy to config.json
└── requirements.txt
gcloud storage buckets create gs://<your-bucket> --location=us-central1
gcloud storage cp data/wi-schools-raw.parquet gs://<your-bucket>/
dev in the same region.cp config.example.json config.json # set project, bucket, dataset, region, repository
pip install -r requirements.txt
jupyter lab wi_schools_pipeline.ipynb
The SQLX files use __GCP_PROJECT__, __GCS_BUCKET__, and __DATASET__ placeholders. The notebook fills them in from config.json when it uploads the definitions.
Data: Wisconsin school directory data (public) and bigquery-public-data.geo_us_boundaries.
Date finished: December 14, 2025
Continue exploring · 34 projects

Fullstack

ML & AI

ML & AI

ML & AI
Distributed Systems

Fullstack

ML & AI
Distributed Systems

Distributed Systems
Distributed Systems
Distributed Systems

Data Engineering
Data EngineeringViewing

Data Engineering

Data Engineering

Data Engineering

ML & AI
ML & AI
Data Engineering

Fullstack

Fullstack
Fullstack

Fullstack

Fullstack
Data Engineering
Computing Foundations

Fullstack

Fullstack
ML & AI
ML & AI

ML & AI
ML & AI
ML & AI
ML & AI