rat_gif_social_banenr.gif

New York City Rat Incidence Map (2024)

Github link: dominicco-official/nyc_rat_map: Rat incidence from 311 complaints and DOH inspections mapped using React, Mapbox and Material UI.

DEMO: Vite + React (https://nyc-rat-map.vercel.app/)

A personal project mapping our 311 Rat Calls and DOH Rat Inspection data across NYC from 2010 to 2024. Techstack included Mapbox SDK, React + Vite, Materials UI, etc. (ON-GOING)

How Might Visualizing Disparate Sources of Rat Activity Provide Valuable Insight For Rat Control?

Project Details

  • DEMO: https://nyc-rat-map.vercel.app

  • Role: Designer, Developer

  • Skills: Front-end Development: React, Javascript, HTML/CSS, Mapbox, Data Science: Python, GIS Software

  • Project Type: MIT Data Visualization and Society Class Personal Project

  • Team: Myself

  • Project Date: 2024

  • Github Link: dominicco-official/nyc_rat_map


Problem

NYC’s Rat Sightings have increased 131% since 2010. Health officials have emphasized the need for focused intervention.

Insight

Multiple data sources of geolocated rat data exist—ranging from Department of Health (DOH) building-level inspections to 311 complaints— but they remain fragmented and are mostly visualized at the neighborhood level rather than the street level.

Question

How might we integrate and visualize disparate rat incidence data sources to uncover actionable insights for public health teams to identify hotspots and patterns at various scales? (i.e. street and building level)


Precedent Research

Existing visualizations typically rely on a single data source and present only broad geographic patterns or detailed street level patterns but at incomprehensible scales (i.e. showing every single rat sighting location but at a zoom scale of 12 which makes the visualization hard to read). In short, they rarely allow inspectors to identify the specific buildings or blocks and their immediate street-level environments that require urgent attention. By combining 311 complaints and DOH building-level checks on the same map, it becomes possible to see not only the “bird’s-eye” neighborhood-level infestation patterns but also the precise properties that show repeated rat activity.

Data Exploration & Cleaning

Before visualizing the data, I wanted to explore the data in order to assess what might be the best way to visualize it. I also needed to clean and to summarize the data in order to make yearly summaries and to make mapping possible on some of the tech stacks I was using. Here are some of my insights:

Concentration of Reports: Most sightings occur in 3+ family apartment buildings, rather than just in abandoned lots or construction sites. Surprisingly, even hospitals have reported rat sightings—over 80 instances in the last seven years.

TEST Temporal Focus: Data between 2010 and 2024 was most robust, informing the core timeline of the visualization.

Temporal Focus: Data between 2010 and 2024 was most robust, informing the core timeline of the visualization.

Data Skewness: Rat reports per building often cluster at low counts, causing skewed distributions. Applying a log transformation helped normalize the data, enabling more meaningful color gradations in the map.

Geospatial Data Optimization: Original NYC shapefiles were dense and slowed web performance. After simplifying geometries by about 45%, loading times improved significantly with only minimal losses in outline detail—an acceptable tradeoff for real-time, web-based exploration.

Tech Stack

Design Challenge

How to layer multiple, complex datasets—like building-level DOH checks and street-level 311 complaints—without overwhelming the user?

3D Visualization Allows For Multiple Layers of Data to Be Shown At Different Angles: I chose Mapbox GL JS for 3D capabilities. Users can pan, rotate, and zoom to reveal different data levels—from macro neighborhood patterns to individual building details.

Complex Filtering Options: Users can also filter out data to help make the reading the visualization more clear and understandable. Attributes attached to the building geometry such as building type and various layers such as trees and catch basin allow the user to correlate this information to rat activity.

Color Normalization + Thematic Styling: Implemented a unified “rat score” that normalizes building-level data. This consistent scale informs both building color intensity and complementary street-level heatmaps. I also Experimented with light vs. dark backgrounds. Dark themes made high-activity areas more visually prominent, aiding quick identification.

Changing Opacity to Allow User to See Hotspots When Blocked by Buildings: At certain angles, the buildings with zero rat activity scores block hotspots of high street level rat activity. To resolve this, I implemented dynamic opacity changing where buildings with zero rat activity had a smaller opacity compared to those that had a rat activity score > 0.

Zoom Levels & Interactivity

Dynamic Scales: At broader zoom levels, a heatmap reveals general hotspots. As users zoom in, building-level and street level granularity of sightings emerges, making it clear where DOH should deploy inspectors.

Pop-ups & Tooltips: Clicking on a building pulls corresponding data from a database and triggers a reverse geocoding API for precise addresses, offering immediate context and enabling inspectors to plan targeted visits.

Data Visualization Insights

Insight 1: Street Level Rat Sightings Visually Correlate With Buildings With Potential Rat Activity.

We see that by comparing the 2010 rat activity heatmap of 2010 vs 2024, and the 2010 rat activity of buildings with that of 2024’s, we see that the areas with highest street level rat activity also likewise are co-located with buildings with high rat activity. I particular the east of lower Manhatten and north of Manhatten have the highest rates of street and building rat activity. Officials should focus on these areas, as well as to tackle buildings with high rat activity presence on streets, as this may indicate poor waste management in the area.

Left image has Multifamily buildings with elevators filtered out, while the right has them not filtered out.

Insight 2: Multifamily buildings with Elevators have the Highest Rat Activity in Lower-North West Manhatten

By filtering out buildings that are Multifamily buildings with elevators, we see a large portion of the buildings with the highest rat activity are filtered out. Filtering allowed us to see, not only the proportion of building types in the area, but to experiment and see which buildings should be focused on to tackle the buildings with the highest rat activities.

Insight 3: As a street level scale example, we see that 41 West 10th Street, a apartment building, has high rat activity, which may have spilled to the street.

As a example of how correlating street level rat sightings with building rat activity, we see that at 41 West 10th Street, there is a cluster of rat sightings of more than 7 within 10 meters of 41 West 10th Street, which has consistently failed DOMH building inspection tests for rats. This suggests that the DOMH should double down efforts on this building as rat activity is not only rampant indoors but also outdoors, which suggests a waste management issue indoors and outdoors, and lack of rat intervention efforts.

What I Would Improve on

There are a couple of things I would like to improve on in this project, including but not limited to:

Correlating Environmental Data With Rat Activity: As of now, the visualization of catch basins and trees did not contribute any notable visual correlation with rat activity heatmaps and buildings with rat activity. As such, perhaps new ways of visualizing their correlation has to be explored, as secondary academic research does indicate that the presence of trees and nearby catchbasins does increase rat incidence.

Optimization of Website Speed: Due to the size of dataset, loading between years is quite slow, and there is a lag. To resolve this, I could play around with limiting zoom levels less than 13 so less data has to be rendered.