UK Sewage Map

A real-time visualization tool showing river sections affected by sewage discharges from combined sewer overflows across the UK.
https://github.com/jonnydawe/uk-sewage-map

Category: Natural Resources
Sub Category: Water Supply and Quality

Last synced: about 19 hours ago
JSON representation

Repository metadata

This map shows real-time information about river sections that might be affected by sewage discharges from combined sewer overflows. Currently, it is limited to the Thames basin.

README.md

UK Sewage Map

A real-time visualization tool showing river sections affected by sewage discharges from combined sewer overflows across the UK. The application combines Event Duration Monitoring (EDM) data with a basic hydrological model to track sewage discharges downstream along non-tidal river networks.

Live Site | Design Files

Overview

The map highlights areas downstream of active and recent discharges, providing near real-time data from water companies' monitoring systems. The application uses a basic hydrological model based on the Center for Ecology and Hydrology's Integrated Hydrological Digital Terrain Model to track sewage movement.

Note: This tool should not be used in isolation to assess pollution or health risks at specific locations, as it does not account for dilution, river flow, or dispersion effects on pollutant concentration.

Architecture

Frontend Stack

  • React application built with Vite
  • ArcGIS JavaScript API for mapping
  • TypeScript for type safety
  • Radix UI and Emotion for styling

Map Features

  • Interactive map with zoom constraints and custom extent
  • Geolocation support
  • Custom search functionality
  • Dark mode support
  • Rain radar overlay
  • Mobile-responsive layout.
  • Custom popup handling for discharge points

Data Architecture

  • Discharge source points are served via ArcGIS hosted feature services
  • Discharge affected river sections are fetched as GeoJSON and rendered as a client-side layer
  • Historical discharge data is fetched from water company APIs
  • Rain radar data is sourced from RainViewer's API

Development Features

  • Type checking with TypeScript
  • ESLint and Prettier for code formatting
  • Husky for git hooks
  • Vitest for testing
  • Path aliases for clean imports

Deployment Architecture

The application is deployed as a static site on Vercel:

  • Frontend assets are built using Vite and deployed to Vercel's edge network
  • Environment variables are managed through Vercel's configuration
  • Automatic branch deployments with unique preview URLs
  • Production deployments triggered by main branch updates
  • Edge caching and CDN distribution for optimal performance
  • Automatic SSL/TLS certificate management
  • Analytics via @vercel/analytics

API Dependencies

  • ArcGIS Services: The application uses ArcGIS JavaScript API services (free tier) for:
    • Base maps and feature layers
    • Spatial analysis and queries
    • Geocoding services
    • Location services
  • RainViewer API: For precipitation radar visualization
  • Water Company APIs: For real-time EDM data

Development Setup

Prerequisites

  • Node.js 18.0.0 or higher
  • ArcGIS API key (for map services)

Local Development

  1. Clone the repository:
git clone https://github.com/JonnyDawe/UK-Sewage-Map.git
  1. Install dependencies:
npm install
  1. Create a .env.local file with your ArcGIS API key:
VITE_ARCGIS_API_KEY=your_api_key_here
  1. Start the development server:
npm run dev

Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run preview - Preview production build
  • npm run lint - Lint and fix code
  • npm run check-types - Type check TypeScript

Data Sources

The application combines several data sources:

Event Duration Monitoring (EDM)

Real-time data is collected through Event Duration Monitoring by individual water companies, providing near-real time data on storm overflows. This data is accessed via the Storm Overflow Hub maintained by Water UK. Storm overflows release untreated, diluted sewage into the environment. Currently, only Thames Water provides an API for accessing historical sewage spill data. For more context, read our article about why water companies need to be more transparent with environmental models and data.

Other Data Sources

  • Center for Ecology and Hydrology's Integrated Hydrological Digital Terrain Model
  • Environment Agency discharge data
  • RainViewer precipitation data

Contributing

We welcome contributions! Please see our contributing guidelines for more details.

Authors

Related Repositories

Disclaimer

While every effort has been made to ensure accuracy, this is experimental software and errors may occur. Please report any issues through our GitHub repositories.


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 1 day ago

Total Commits: 163
Total Committers: 4
Avg Commits per committer: 40.75
Development Distribution Score (DDS): 0.239

Commits in past year: 38
Committers in past year: 3
Avg Commits per committer in past year: 12.667
Development Distribution Score (DDS) in past year: 0.289

Name Email Commits
Jonny Dawe 5****e 124
copilot-swe-agent[bot] 1****t 27
Alex Lipp a****x@l****k 11
Sudhir Balaji s****i@g****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 22 days ago

Total issues: 17
Total pull requests: 23
Average time to close issues: 6 months
Average time to close pull requests: 5 days
Total issue authors: 4
Total pull request authors: 4
Average comments per issue: 0.76
Average comments per pull request: 3.17
Merged pull request: 20
Bot issues: 0
Bot pull requests: 0

Past year issues: 5
Past year pull requests: 8
Past year average time to close issues: about 2 months
Past year average time to close pull requests: 12 days
Past year issue authors: 2
Past year pull request authors: 3
Past year average comments per issue: 0.4
Past year average comments per pull request: 6.0
Past year merged pull request: 5
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/jonnydawe/uk-sewage-map

Top Issue Authors

  • AlexLipp (12)
  • jpsingleton (3)
  • JonnyDawe (1)
  • cathysinden-maker (1)

Top Pull Request Authors

  • JonnyDawe (12)
  • Copilot (5)
  • AlexLipp (5)
  • sudhir-b (1)

Top Issue Labels

  • enhancement (4)
  • bug (2)

Top Pull Request Labels


Dependencies

package-lock.json npm
  • 489 dependencies
package.json npm
  • @babel/plugin-transform-typescript ^7.20.13 development
  • @babel/preset-typescript ^7.18.6 development
  • @types/react ^18.0.25 development
  • @types/react-dom ^18.0.8 development
  • @types/styled-components ^5.1.26 development
  • @typescript-eslint/eslint-plugin ^5.10.2 development
  • @typescript-eslint/parser ^5.10.2 development
  • @vitejs/plugin-react ^4.0.0 development
  • babel-plugin-styled-components ^2.0.7 development
  • eslint ^8.8.0 development
  • eslint-config-prettier ^8.10.0 development
  • eslint-plugin-import ^2.28.0 development
  • eslint-plugin-jsx-a11y ^6.7.1 development
  • eslint-plugin-prettier ^4.2.1 development
  • eslint-plugin-react ^7.33.1 development
  • eslint-plugin-simple-import-sort ^7.0.0 development
  • gh-pages ^5.0.0 development
  • pre-commit ^1.2.2 development
  • prettier ^2.8.8 development
  • typescript ^5.1.6 development
  • vite ^4.4.8 development
  • @arcgis/core ^4.27.6
  • @esri/calcite-components-react 1.4.3
  • @radix-ui/react-dialog ^1.0.3
  • @radix-ui/react-popover ^1.0.6
  • @radix-ui/react-separator 1.0.2
  • @radix-ui/react-tabs ^1.0.4
  • @radix-ui/react-visually-hidden ^1.0.2
  • @react-spring/web ^9.7.3
  • @vercel/analytics ^1.0.1
  • arcgis-animate-markers-plugin ^1.1.5
  • react ^18.2.0
  • react-dom ^18.2.0
  • react-google-charts ^4.0.1
  • react-wavify ^1.8.3
  • styled-components ^5.3.6
  • swr ^2.2.1

Score: 4.1588830833596715