If you have ever tried to visit a NYC beach shortly after it rains heavily, you may be disappointed to find that beach closed.

The reason is one of every NYC environmentalist’s worst nightmares: Combined Sewer Outflows (CSOs). Put simply, New York City’s sewage goes to the same place as its street drainage. That works fine until we get so much rain that the sewage treatment plants can’t handle both the storm water and the sewage flowing through our sewers. As a result, this combination of stormwater and sewage overflows and that resulting backup is released into our very own New York City waterways. For the curious, check out this great page by the DEP which include descriptions of CSOs and maps of the outflows.

So back to the beach– what causes it to close exactly? Well, the city monitors its waterways for Fecal Coliform, something that is as gross as it sounds. Specifically, its a bacteria that grows in the intestines of warm blooded animals. High level of fecal coliform indicates a high probability of raw sewage in the water. If levels go above 1,000 coliform per 100ml of water, beaches are closed in accordance with state regulations.

To find the dirtiest water in New York City (or at least the most sewage-full water, since there are many different ways to measure water quality), I turned to Harbor Water Sampling Data released as Open Data by the DEP. The dataset includes samples from dozens of sites back to 2008.

I explored the mean, minimum, median and max levels of fecal coliform at each site, but to decide which area was the dirtiest, I calculated the percent of days sampled at the site that registered as too dirty to swim in (i.e. above the safe level of 1000 coliform / 100ml).

The Top 10 dirtiest water sample locations by that measure are below:

The dirtiest water? Coney Island Creek, which sits between Coney Island and the rest of Brooklyn. Not far behind it is Bergen Basin, near JFK. These two are at the top of the list by the mean measurement as well. The Bronx River is number 3, Alley Creek is 4 and Bergen Basin comes back for number 5. At all five of these spots, samples came in as having too much fecal coliform to swim in more than half the time! So I mapped out these five “fecal hot spots” below:

Spots 6 - 10 go to two sites in the Gowanus Canal, Flushing Creek and another site in both The Bronx River and Coney Island Creek.

To expand beyond the top 10 spots, I created the interactive map below, which includes all of the harbor locations that were measured in the DEP data. Just like the analysis above, I mapped the percentage of time that water levels were unsafe for swimming. Larger circles indicate a higher percentage of unsafe days, and thus dirtier water. Clicking on a circle gives you fuller details for that site.

Note that the larger circles appear more inland. The conclusion? If you are going to swim in NYC, i guess the rule of thumb is to stay away from anything with the word “creek” in its name (and of course “canal”) and head toward the rivers. The one exception seems to be the Bronx River. I suppose its sort of intuitive… interior waterways have much less water to dilute waste matter and they generally move slower than their large river counterparts. (Of course this is more of a theoretical swim. If you are ACTUALLY going to swim, hit up the beaches!) The best part of all of this? I may have just discovered the origin of the old saying “Up sh*t creek without a paddle”.

-Analysis done in Excel (pivot tables)

-Map formed in QGIS and then exported to CartoDB

-All Data used can be found here.

Update: This map has since made an appearance in my TEDxNewYork talk. To hear about it, and how NYC can make Open Data a better tool for all citizens, click here.