Skip to content
Vibhrav Jha.Let’s talk
All projectsData Engineering

GCP Geospatial Pipeline

Spatial answers over 2,116 schools and 72 counties

My contributionCloud ingestion, Dataform transformations and spatial SQL analysis.

FieldData Engineering

View repository

Academic project

Wisconsin schools in their geographic context — explanatory architecture diagram

The work
behind the interface.

Matched 2,116 Wisconsin schools to 72 county polygons through a dependency-managed Cloud Storage, Dataform and BigQuery pipeline.

  • Google Cloud Storage
  • Dataform
  • BigQuery
  • SQL

The result

Spatially matched 2,116 public schools against 72 county polygons and explored nearest-school questions.

The problem

Built a Cloud Storage-to-Dataform-to-BigQuery workflow relating Wisconsin schools to county geography.

A decision worth examining

Express spatial joins as dependency-managed SQLX transformations and inspect bytes scanned for query-cost context.

Read the README.

View original README
READMEArchitecture, setup and usage

GCP Geospatial Data Pipeline: GCS → Dataform → BigQuery

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.

Architecture

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.

Pipeline definitions

ActionTypeWhat it does
schoolsoperationLOAD DATA OVERWRITE from the Parquet file in GCS
wi_countiestableWisconsin (FIPS 55) county polygons from BigQuery public data
wi_county_schoolstableBuilds ST_GEOGPOINT from each school's lat/long and assigns its county with ST_CONTAINS

Analysis

QuestionTechniqueResult
How many Wisconsin counties are there?row count on wi_counties72
How many public schools were matched to a county?spatial join2,116
Which counties have ≥ 2 cities with ≥ 3 public high schools?BigQuery pipe syntax (|>), two-level aggregationBrown, 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 schoolST_DISTANCE + MIN_BY over a cross joine.g. Badger Ridge Middle → Verona Area High

Tech stack

Google Cloud Storage · Dataform (SQLX) · BigQuery · BigQuery GIS · Compute Engine VM · Python (google-cloud-bigquery, google-cloud-dataform, PyArrow, pandas) · Jupyter

Project structure

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

Running it

  1. Create a GCS bucket and upload the data:
    gcloud storage buckets create gs://<your-bucket> --location=us-central1
    gcloud storage cp data/wi-schools-raw.parquet gs://<your-bucket>/
    
  2. Create a BigQuery dataset, plus a Dataform repository with a workspace named dev in the same region.
  3. Configure and run:
    cp config.example.json config.json   # set project, bucket, dataset, region, repository
    pip install -r requirements.txt
    jupyter lab wi_schools_pipeline.ipynb
    
  4. After compiling, start a workflow invocation in the Dataform UI (or through the API) to materialize the tables before running the analysis cells.

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

Chinook Music Store SQL Analytics

  1. Aranyaka wildlife-image application interface

    Fullstack

    Aranyaka

  2. DermaNet hackathon prototype showing classification output and a generated explanation

    ML & AI

    DermaNet

  3. AI-generated concept illustration of source documents connected to retrieved evidence and an answer

    ML & AI

    Private-Data RAG

  4. Before It Breaks dashboard separating real weather from synthetic equipment telemetry and estimated costs

    ML & AI

    Before It Breaks

  5. Architecture diagram of simulated stock records flowing through Kafka to HDFS

    Distributed Systems

    Stock Streaming Engine

  6. Vyaya dashboard with clearly labeled synthetic demonstration data

    Fullstack

    Vyaya

  7. Study assistant interface with retrieved source context

    ML & AI

    Fine-Tuning vs. RAG

  8. Architecture diagram of NOAA data, a Cassandra cluster and a query service

    Distributed Systems

    Distributed Weather Data System

  9. Distributed Property Lookup Service project image

    Distributed Systems

    Distributed Property Lookup Service

  10. Architecture diagram connecting MySQL, a gRPC service and HDFS storage

    Distributed Systems

    HDFS & SQL Pipeline

  11. Architecture diagram of Spark processing, SQL and analysis

    Distributed Systems

    Spark Analytics

  12. Multi-Source ELT Pipeline project image

    Data Engineering

    Multi-Source ELT Pipeline

  13. Wisconsin schools in their geographic context — explanatory architecture diagram

    Data EngineeringViewing

    GCP Geospatial Pipeline

  14. Chinook Music Store SQL Analytics project image

    Data Engineering

    Chinook Music Store SQL Analytics

  15. Yelp Geospatial Analytics project image

    Data Engineering

    Yelp Geospatial Analytics

  16. E-Commerce Semantic Search Engine project image

    Data Engineering

    E-Commerce Semantic Search Engine

  17. Retail Sales Forecasting project image

    ML & AI

    Retail Sales Forecasting

  18. Making tool dependencies inspectable — explanatory architecture diagram

    ML & AI

    AI Agent Tool Dependency Graph

  19. From public records to operational questions — explanatory architecture diagram

    Data Engineering

    Palantir Foundry and AIP Build Challenge

  20. StudyFlow study-session dashboard

    Fullstack

    StudyFlow

  21. Habit Command Center planning dashboard

    Fullstack

    Habit Command Center

  22. Interfaces across web and mobile — explanatory architecture diagram

    Fullstack

    React Web & Mobile

  23. Startup Scout project image

    Fullstack

    Startup Scout

  24. Inventory-Based Recipe Planner project image

    Fullstack

    Inventory-Based Recipe Planner

  25. Concurrent Word Count and Performance Benchmarking project image

    Data Engineering

    Concurrent Word Count

  26. Data structures matched to their assumptions — explanatory architecture diagram

    Computing Foundations

    Algorithm Design

  27. Campus Navigator project image

    Fullstack

    Campus Navigator

  28. i-Songly: Song Management Engine project image

    Fullstack

    i-Songly

  29. An experiment that can resume — explanatory architecture diagram

    ML & AI

    CIFAR-100 with LeNet

  30. Fashion-MNIST Neural Network Classifier project image

    ML & AI

    Fashion-MNIST Classifier

  31. PCA Eigenfaces and Image Reconstruction project image

    ML & AI

    PCA Eigenfaces

  32. Two routes to the same regression objective — explanatory architecture diagram

    ML & AI

    Lake Mendota Ice Regression

  33. Bayesian Language Detection project image

    ML & AI

    Bayesian Language Detection

  34. Explanatory diagram of the video-fingerprint benchmark: 25 sources, 75 transformed variants and 1,875 comparisons.

    ML & AI

    Video-Fingerprint Benchmark

All projects