# Canada Traffic Signal Locations & Intersection Dataset (OSM) (`scholarstack/canada-traffic-signal-extractor`) Actor

OSM-derived, deduplicated inventory of Canadian signalized intersections and crossings — classified by signal type, with approach count and accessibility (APS) flags, by province and city. One result = one intersection. CSV/JSON/Excel/KML. Data © OpenStreetMap contributors (ODbL 1.0).

- **URL**: https://apify.com/scholarstack/canada-traffic-signal-extractor.md
- **Developed by:** [ScholarStack](https://apify.com/scholarstack) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $30.00 / 1,000 delivered intersections

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Canada Traffic Signal Locations & Intersection Dataset — All Provinces (OSM + Official Open Data)

**Extract clean, deduplicated locations of every signalized intersection, traffic light and signalized pedestrian crossing in Canada.** This actor turns raw OpenStreetMap data into a normalized, ready-to-use dataset of Canadian traffic signals — one record per intersection — covering **all 13 provinces and territories**, classified by signal type, confirmed against official city open data where available, and exportable as **JSON, CSV, Excel, or KML**.

Built for **V2X / C-ITS, GLOSA, traffic simulation (SUMO, PTV Vissim, Aimsun), HD maps, routing, smart-city planning, and accessibility (AODA) analysis.**

> One result = one signalized intersection. Run `dryRun: true` for a free count + cost estimate + sample before you pay anything.

***

### What this actor does

OpenStreetMap maps a traffic signal as several separate nodes (one per approach, one per crosswalk). Raw OSM is noisy and hard to use. This actor:

1. **Extracts** every `traffic_signals` / `crossing=traffic_signals` node across Canada from the latest OpenStreetMap (Geofabrik) province extracts.
2. **Consolidates** the scattered nodes into **one clean record per real intersection** (approach signals and crosswalks folded into a single point).
3. **Classifies** each one by signal type (vehicular junction, pedestrian crossing, combined, HAWK, level crossing).
4. **Fuses official city open data** where a city publishes it (Toronto, Montreal, Calgary, Winnipeg), snapping to the city's authoritative coordinates and flagging the match.
5. **Clips to real city limits** (admin boundary) so a city query returns that city only — not neighbouring municipalities.
6. **Enriches** with approach-arm count, nearest street names, and ADA / accessible-pedestrian-signal (APS) flags.

***

### Coverage

| Scope | Detail |
|---|---|
| **Countries** | Canada 🇨🇦 |
| **Provinces & territories** | All 13 — ON, QC, BC, AB, MB, SK, NS, NB, NL, PE, NT, YT, NU |
| **Named cities** | 43 metros (Toronto, Montréal, Vancouver, Calgary, Ottawa, Edmonton, Winnipeg, Hamilton, Québec City, Halifax, and more) |
| **Official-data fusion** | Toronto, Montréal, Calgary, Winnipeg (more added over time) |
| **Whole-province mode** | Every signal in a province, including rural towns and highway corridors |
| **Source data** | OpenStreetMap, refreshed from the latest Geofabrik snapshot |

Approximate city totals (run `dryRun` for the exact count): Toronto ≈ 2,540 signalized intersections, with every province covered — from the GTA down to single-signal towns in PEI and Yukon.

***

### What you get (output fields)

| Field | Description |
|---|---|
| `intersection_id` | Stable, location-based ID, e.g. `CA-ON-TOR-dpxrvzku` |
| `state_code` | Province / territory code (`ON`, `QC`, `BC`, …) |
| `city_slug` / `city_name` | City key and display name |
| `lat` / `lon` | Intersection coordinate (WGS84); official position when matched |
| `osm_id` | Representative OpenStreetMap node id |
| `signal_type` | `vehicular_junction`, `pedestrian_crossing`, `vehicular_and_pedestrian`, `hawk_signal`, `level_crossing` |
| `has_pedestrian_crossing` | Whether the junction includes a signalized pedestrian phase |
| `approach_count` | Number of road arms meeting at the junction |
| `nearest_street` / `street_names` | Named roads at the intersection |
| `accessibility` | ADA / APS flags: `button_operated`, `sound_signal`, `tactile_paving`, `countdown_display`, `vibration_signal`, `bicycle_signal`, `leading_pedestrian_interval` |
| `source_tier` | `osm`, or `official+osm` where confirmed by city open data |
| `official_id` / `distance_delta_m` | City's signal ID and OSM-vs-official distance (when matched) |
| `confidence` | Score 0–1 with reason (raised where OSM and official agree) |
| `osm_last_edited` / `data_vintage` | OSM edit time and data snapshot date |
| `attribution` / `license` | `© OpenStreetMap contributors, ODbL 1.0` |

Export as **JSON, CSV, Excel, or KML** (Google Earth ready).

***

### Signal type taxonomy

| Value | Meaning |
|---|---|
| `vehicular_junction` | Road junction traffic signal |
| `pedestrian_crossing` | Stand-alone signalized pedestrian crossing / mid-block crosswalk |
| `vehicular_and_pedestrian` | Road junction that also runs a pedestrian phase |
| `hawk_signal` | HAWK pedestrian beacon |
| `level_crossing` | Signalized railway level crossing |

***

### How to use it

Pick one input mode:

| Mode | Input | Returns |
|---|---|---|
| Single city | `city: "on-toronto"` | Toronto, clipped to city limits, official-fused |
| Multiple cities | `cities: ["qc-montreal", "bc-vancouver"]` | Any combination |
| Whole province | `state: "ON"` + `wholeState: true` | Every signal in Ontario |
| Custom area | `customBbox: "43.6,-79.5,43.8,-79.2"` | Any rectangle |

Key options: `signalType` (filter by type), `minConfidence`, `includeAccessibility`, `clusterRadiusMeters` / `mergeRadiusMeters`, `maxResults` (`0` = all), `includeKml`, and `priorDatasetId` for **Delta Mode** (only pay for changed intersections on re-runs).

Always try **`dryRun: true`** first — it returns the exact count, estimated cost, and 10 sample records, free.

***

### Output example

```json
{
  "intersection_id": "CA-ON-TOR-dpxrypfj",
  "state_code": "ON",
  "city_slug": "on-toronto",
  "city_name": "Toronto",
  "lat": 43.593396,
  "lon": -79.53818,
  "signal_type": "vehicular_and_pedestrian",
  "has_pedestrian_crossing": true,
  "approach_count": 6,
  "nearest_street": "Lake Shore Boulevard West",
  "street_names": ["Thirty Seventh Street", "Lake Shore Boulevard West"],
  "source_tier": "official+osm",
  "official_id": "240",
  "distance_delta_m": 3.4,
  "confidence": { "score": 0.97, "reason": "official_and_osm_agree_within_5m" },
  "accessibility": { "tactile_paving": true, "sound_signal": null },
  "data_vintage": "2026-10-18",
  "attribution": "© OpenStreetMap contributors, ODbL 1.0"
}
```

***

### Use cases

- **V2X / C-ITS & connected vehicles** — intersection inventories for GLOSA, SPaT/MAP, and RSU/OBU deployment planning.
- **Traffic simulation** — seed SUMO, PTV Vissim/Visum, or Aimsun networks with real signalized-intersection locations.
- **HD maps & autonomous driving** — a fresh, classified signal layer with update timestamps.
- **Routing & micromobility** — signalized pedestrian crossings and accessibility flags.
- **Smart city & accessibility (AODA)** — accessible-pedestrian-signal (APS) coverage analysis.
- **Insurance & risk analytics** — signalized-intersection density by city or province.
- **Research & GIS** — a clean, attributed, nationwide Canadian signal dataset.

***

### Pricing

Pay-per-result — you're charged only for the intersections delivered:

| Item | Price |
|---|---|
| Per delivered intersection | $0.03 |
| KML export (optional, per run) | $0.25 flat |
| `dryRun` (count + cost estimate + samples) | **Free** |

Use **Delta Mode** (`priorDatasetId`) to be charged only for added/removed/changed intersections on repeat runs.

***

### Data sources, licensing & privacy

- **OpenStreetMap** via Geofabrik — **ODbL 1.0**. Commercial use permitted; attribution required: *© OpenStreetMap contributors*.
- **Official municipal open data** (Toronto, Montréal, Calgary, Winnipeg) under each city's Open Government Licence / CC-BY — commercial use permitted with attribution.
- **Privacy:** traffic-signal coordinates are public infrastructure geometry, not personal data — no PII is collected or distributed.

Always keep the `attribution` field with any redistribution of the data.

***

### FAQ

**Does it cover all of Canada?**
Yes — all 13 provinces and territories. Use a named city for a boundary-accurate, official-fused result, or `wholeState` for every signal in a province including small towns and highways.

**How accurate is it?**
Validated against official city inventories: ~95% of Toronto's official signals and ~90%+ of Calgary's are matched, with OSM-vs-official positions typically within 5–30 m. Matched intersections use the official coordinate.

**What's the difference between OSM-only and official records?**
`source_tier: official+osm` means a city open-data record confirms the intersection (higher confidence, official position). `source_tier: osm` means it comes from OpenStreetMap only — still accurate, just not independently confirmed.

**Can I get just pedestrian crossings, or just vehicular junctions?**
Yes — filter with `signalType`.

**How fresh is the data?**
Sourced from the latest OpenStreetMap Geofabrik snapshot; the snapshot date is in every record's `data_vintage`.

**What formats can I export?**
JSON, CSV, Excel, and KML (Google Earth).

***

*Canada traffic signals · signalized intersections · traffic light locations · pedestrian crossings · accessible pedestrian signals · OpenStreetMap · V2X · GIS · all provinces.*
*Data © OpenStreetMap contributors, ODbL 1.0.*

# Actor input Schema

## `city` (type: `string`):

Select a single city (e.g. Toronto). Ignored if customBbox is set. For multiple cities use 'Cities' below; for all cities in a state use 'State'.

## `cities` (type: `array`):

Select multiple cities to process in one run. All results are delivered into a single dataset. Overrides 'City' if set. Ignored if 'State' or 'Custom bbox' is set.

## `state` (type: `string`):

Select a state to process ALL its cities in one run. Overrides 'City' and 'Cities' inputs. Ignored if 'Custom bbox' is set.

## `customBbox` (type: `string`):

Override everything with your own bbox: "south,west,north,east" in decimal degrees. Example: "34.00,-118.50,34.20,-118.20"

## `clusterRadiusMeters` (type: `integer`):

Signals within this radius are grouped into one intersection. Default 40m suits dense Canadian grids. Raise it (e.g. 70m) for sprawling suburbs with wide junctions.

## `officialMatchRadiusMeters` (type: `integer`):

When official city signal data exists, an OSM intersection within this distance of an official signal is treated as the same intersection and snapped onto the official (more accurate) position. Chosen from the nearest-official distance distribution; 30m captures same-intersection offsets without merging distinct neighbours (which sit 60m+ apart).

## `mergeRadiusMeters` (type: `integer`):

Centroids within this radius of each other are merged into one intersection. Default 40m. Lower it if separate nearby junctions get merged; raise it if duplicate points appear at one wide multi-carriageway junction.

## `signalType` (type: `array`):

Filter by intersection signal type. Pick one or more, or 'All'. vehicular_junction = road junctions; pedestrian_crossing = crossings; vehicular_and_pedestrian = junction with a pedestrian phase; hawk_signal = HAWK pedestrian beacon; level_crossing = rail crossing.

## `minConfidence` (type: `integer`):

Drop intersections whose confidence score is below this value (0–100, interpreted as 0.00–1.00). 0 = keep all. Phase 1 scores are OSM-density based.

## `includeAccessibility` (type: `boolean`):

Include the ADA / accessibility block (button_operated, sound_signal, tactile_paving, countdown_display, …) in each output record.

## `wholeState` (type: `boolean`):

Process EVERY signalized intersection in the selected State's data, ignoring city selection. Use together with 'State'. Large output — run dryRun=true first to see the count and cost.

## `includeKml` (type: `boolean`):

Also produce a Google Earth / KML file of the delivered intersections (saved to the run's key-value store with a public URL). Off by default. Charged once per run as a flat KML-export fee — see Pricing.

## `maxResults` (type: `integer`):

Cap the total number of intersections delivered (and charged) across all cities. 0 = unlimited. Run dryRun=true first to see the full count.

## `dryRun` (type: `boolean`):

When true, runs the full pipeline but charges nothing and delivers nothing. Returns estimated count, estimated cost, and a 10-row sample.

## `priorDatasetId` (type: `string`):

The defaultDatasetId of a previous run of this actor for the same city/state. Find it in the run's Storage tab in Apify Console. When set, only added, removed, and changed intersections are charged.

## `kmlFromDatasetId` (type: `string`):

Forgot to enable KML on a previous run? Paste that run's defaultDatasetId (Storage tab) here and run again. The actor builds a KML from those exact results and charges ONLY the flat $0.25 KML fee — no re-extraction, no per-intersection charges. Leave empty for normal runs.

## Actor input object example

```json
{
  "city": "on-toronto",
  "clusterRadiusMeters": 40,
  "officialMatchRadiusMeters": 30,
  "mergeRadiusMeters": 40,
  "signalType": [
    "all"
  ],
  "minConfidence": 0,
  "includeAccessibility": true,
  "wholeState": false,
  "includeKml": false,
  "maxResults": 1000,
  "dryRun": false
}
```

# Actor output Schema

## `intersections` (type: `string`):

One record per signalized intersection — coordinates, signal type, approach count, accessibility (APS) flags, nearest street, source tier and confidence. Exportable as JSON, CSV, or Excel.

## `runSummary` (type: `string`):

Counts, coverage and (for dryRun) the free cost estimate for the run.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("scholarstack/canada-traffic-signal-extractor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("scholarstack/canada-traffic-signal-extractor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call scholarstack/canada-traffic-signal-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scholarstack/canada-traffic-signal-extractor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/152N6WphgPdeCvoc2/builds/G32hOfJb90HOaNka1/openapi.json
