San Francisco Pavement Condition Index (PCI) Map

The Pavement Condition Index (PCI) is a numerical rating system used to assess the condition of road surfaces based on their distress levels. This index helps city planners prioritize road maintenance and improve transportation infrastructure. This map visualizes PCI scores across San Francisco, allowing users to see areas requiring attention. Tap the markers for PCI scores and rating dates. Max results 2,000 of 20,000.

Excellent (85-100)
Good (70-84)
At Risk (50-69)
Poor (25-49)
Very Poor (0-24)

Blocks and Intersections:

Features
Development
Purpose
  1. Explore AI tooling for development.
  2. Rapidly create a micro app through idea, development and deployment using AI tools.
  3. Perform something useful for San Francisco.
AI Code Generation and Engineering Chat
Code

The code was entirely produced by AI with slight manual modifications. This is a single page micro app using HTML, CSS and client side JavaScript calling the DataSF API. The Bootstrap framework was chosen to help rapidly develop a basic UI that was responsive and tested across 3 display sizes: iPhone, iPad, and desktop. OpenStreetMap was used for the map with Leaflet for the markers and positioning. Searching within the bounds of the map was instrumental, and although DataSF's API on Socrata SoQL offers the within_box() function, it was unusable due to the data source not providing a location data type to search on. A simple query using the data source's latitude and longitude fields was used instead to search within the bounds of the map. Implementation of the colored pins and adjusting the map's zoom levels to snap to multiples of 0.25 while fitting the bounds of the map to the results was key to making the map useful. For local network testing on iPhone and iPad, a Python http server was used to serve the HTML on a MacBook Pro.

Deployment

AWS Route53 and EC2 Ubuntu t2.micro instance (free) running NGINX web server. AWS Q AI chat was employed in technical discussions. It was completely deployed from domain registration to serving in a few hours.

Data Source

San Francisco Department of Public Works via DataSF. DPW contracts a vehicle to drive city streets and take photos of the streets and later manually rates these streets. Most PCI scores were updated in October 2023. DPW states this is done yearly. PCI scores prior to 2018 are ignored and considered inaccurate. The dropdown of 'Worst Streets' is dynamic, and any updates to PCI scores will be reflected in this list.



contact@pavesf.com