A web application that helps identify and improve the quality of OpenStreetMap data in Dundee. The tool visualizes the completeness of place data (cafes, supermarkets, etc.) and provides an interactive way to discover places that need updating.
You can see the site at https://osm.dundee.opendata.scot/.
- Interactive Map: Visualize places across Dundee with colour-coded markers indicating data quality
- Quality Assessment: Evaluate completeness of name, address, and opening hours data
- Category Filtering: Switch between different place reports (cafes, supermarkets, etc.)
- Smart Place Picker: Randomly select places with missing data to visit and update
- Summary Statistics: View overall data quality metrics for each category
- Direct OSM Editing: Quick links to edit places directly in OpenStreetMap
- Mobile-Friendly: Responsive design that works on all devices
These are currently fixed but will be dynamic per report type
- 🟢 Green: Complete data (name, address, and opening hours)
- 🟠 Orange: Partial data (missing 1-2 fields)
- 🔴 Red: Missing data (missing 2-3 fields)
- Node.js (for the Cloudflare Worker)
- Ruby and Jekyll (for the static site)
-
Clone the repository
git clone https://github.com/opendatascotland/dundee_osm_health.git cd dundee_osm_health -
Set up the Cloudflare Worker
cd osm-dundee-worker npm install -
Run the worker locally
npx wrangler dev
The worker will start on
http://localhost:8787 -
Set up the static site
cd site bundle install -
Run the development server
For local development (connects to worker at localhost:8787):
bundle exec jekyll serve --config _config.yml,_config_dev.ymlFor production testing:
bundle exec jekyll serve
The application will be available at http://localhost:4000
Note: When running locally, make sure both the Cloudflare Worker (step 3) and Jekyll site (step 5) are running simultaneously. The site uses
_config_dev.ymlto point to the local worker athttp://localhost:8787instead of the production worker URL.
- Uses Leaflet.js for interactive mapping
- Custom legend control with toggle functionality
- Responsive design with mobile-first approach
- Real-time data filtering and visualization
- Fetches data from OpenStreetMap Overpass API
- Processes and filters place data for Dundee
- Returns JSON data for frontend consumption
- Handles different place categories (cafes, supermarkets, etc.)
- Caches responses for 15 minutes using Cloudflare's edge cache
The application evaluates three key data fields at the moment:
- Name: Presence of a proper business name
- Address: Complete address (street, house number/unit/housename, postcode)
- Opening Hours: Business operating hours
- Select a Category: Use the tabs at the top to switch between different place type reports
- View the Map: See colour-coded markers indicating data quality
- Use the Legend: Toggle the legend to understand marker colours and filter options
- Click "Pick a place to visit and update": The button below the map will randomly select a place with missing data
- Review Details: The selected place will be highlighted and its details shown
- Visit and Update: Use the "Update this" link to edit the place in OpenStreetMap
- Hide Incomplete: Toggle to show only places with complete data
- Legend Toggle: Collapse/expand the legend on mobile devices
Create a new report .md file in site/_reports/ with the following schema:
---
title: "Cafes" # Your report name - determines the name of the tab in the app
description: "A list of cafes in Dundee" # A description of what the report pulls
query: | # An Overpass API query
[out:json][timeout:25];
// Fetch the Dundee area
area["name"="Dundee City"]["admin_level"="6"]->.searchArea;
// Find all cafes within the Dundee area
(
node["amenity"="cafe"](area.searchArea);
way["amenity"="cafe"](area.searchArea);
relation["amenity"="cafe"](area.searchArea);
);
out center;
---- Modify the center coordinates in
site/index.html - Adjust zoom levels and tile layers as needed
- Customize marker icons and colours
- OpenStreetMap: Primary data source via Overpass API
- Geographic Scope: Dundee, Scotland
- Update Frequency: Real-time via API calls to Overpass API