gridloc / README.md
lassanmonster's picture
GridLoc: Bengaluru parking congestion digital twin
db3dbe1
|
Raw
History Blame Contribute Delete
5.88 kB
metadata
title: GridLoc Traffic Twin
emoji: 🚦
colorFrom: red
colorTo: indigo
sdk: docker
app_port: 7860
pinned: false
license: mit

GridLoc

A living digital twin of Bengaluru's streets that finds where illegal parking quietly chokes traffic, and where the cameras are not even looking.

GridLoc turns roughly 293,000 parking violation records into a ranked, time aware enforcement plan. It scores every 170 metre cell of the city across four daily time blocks, labels each one, and surfaces the zones that matter most for a supervisor with two minutes before a shift briefing.


The idea in one paragraph

A violation dataset records where enforcement looks, not where illegal parking actually happens. Count the busy cells, call them hotspots, and you have just redrawn the camera map. GridLoc avoids that trap by computing two independent scores per cell. Observed comes only from the recorded violations, weighted by how much each one obstructs traffic. Expected comes only from city conditions, the proximity to demand generators and the road hierarchy, and never touches the violation data. Comparing the two is where the insight lives.

The four categories

Every cell, for every time block, lands in one of four buckets:

Low Observed High Observed
High Expected Blind Spot Conditions predict heavy parking, little recorded. Look here. Confirmed Busy in data and conditions agree. Enforce.
Low Expected Calm Quiet and expected to be quiet. Do not waste patrols. Quirk High tickets, low demand. Likely a one off or a trap.

The blind spots are the headline output. They are high demand corridors where recorded enforcement is lower than conditions warrant, which is the one thing no count based method can produce.

What is inside

  • Landing page. A scrollytelling walk through the problem, the Observed vs Expected idea, the method, and the real results, built as a single animated experience.
  • The twin (dashboard). A 3D map of Bengaluru where every scored cell rises as a colored tower. Pick a time of day shift to re-rank the city, scroll the ranked zone list, and click any cell to drop into a detail panel with its score, observed vs expected split, time band profile, and where it sits against every other cell in the city.

Key numbers

  • 292,768 cleaned violation records across 2,534 hexagonal cells
  • 5,224 scored cell by time block rows
  • 47 cells certified as statistically real hotspots (Getis-Ord Gi*, z up to 8.59)
  • 95 confirmed, 661 blind spots, 57 quirks, the rest calm
  • Rankings hold at Spearman rho greater than or equal to 0.998 under weight perturbation

Tech stack

  • React 19 and TanStack Start (SSR) with TanStack Router
  • MapLibre GL for the basemap and deck.gl for the H3 hexagon and road layers
  • Three.js and React Three Fiber for the landing page visuals
  • Tailwind CSS v4, Zustand for state, Lenis for smooth scroll
  • Vite 7 for build and dev, h3-js and Turf for the spatial work

Run it locally

npm install
npm run dev

The dev server starts on http://localhost:3000. To build and run the production server:

npm run build
npm start

Run it with Docker

docker build -t gridloc .
docker run -p 7860:7860 gridloc

Then open http://localhost:7860.

Deploy to Hugging Face Spaces

This repository is ready to deploy as a Docker Space. The frontmatter at the top of this file configures the Space, and app_port: 7860 matches the port the container listens on.

  1. Create a new Space and choose Docker as the SDK (blank template).
  2. Push this repository to the Space, or connect it to your GitHub repo.
  3. The Space builds the Dockerfile and serves the app. No extra secrets or build settings are needed.

Data and honest caveats

The figures here are real model output, but the project is deliberately upfront about its limits:

  • Impact is estimated, not measured. Congestion impact is inferred from vehicle and violation type, not from live road speeds.
  • Blind spots are inferred risk. A blind spot means a high demand location with sparse recorded enforcement, worth investigating, not proven uncaught parking.
  • Timestamps are relative. The source dataset is synthetic and transformed, so the four time blocks are data derived ranges with no real world clock or day of week meaning. The app makes no calendar claims.
  • Coverage follows the cameras. Cells exist only where violations were recorded. Areas with no cell are areas with no recorded data, which may be genuinely calm or simply unwatched.

Project structure

src/
  components/
    landing/   the scrollytelling landing page
    twin/      the dashboard panels (zone list, detail, map controls)
    ui/        shared visual primitives
  lib/twin/    the data model, scoring, H3 helpers, map layers
  data/        the scored model output and road geometry
  routes/      TanStack Router routes (landing and dashboard)
scripts/       build time data prep (Bengaluru boundary)
imp_docs/      the methodology and technical write up

Credits

Built for the Flipkart GRiD challenge by team Kuch_Nhi_Aata. Mapping and geocoding context from MapmyIndia / Mappls. Road geometry from OpenStreetMap. Violation data from the Bengaluru Traffic Police ASTraM platform (synthetic, organiser supplied).

Source: https://github.com/Krish-kukreja/Kuch_Nhi_Aata-Gridlock


Built by four people who kept saying Kuch nhi aata then shipped it anyway.