Skip to content

Commit

Permalink
Update vehicle counts layer to show all years and emphasize data source
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Mar 13, 2024
1 parent 3089a64 commit 8219ae1
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions src/lib/browse/layers/points/VehicleCounts.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
let name = "vehicle_counts";
let colorScale = colors.sequential_low_to_high;
// Manual buckets for motor_vehicles_2022, which max out at 205,000
// Manual buckets for motor_vehicles, which max out at 205,000
let limits = [0, 40000, 80000, 120000, 160000, 205000];
// Remove some because there's not much width
let describeLimits = ["", "40k", "80k", "120k", "160k", ""];
Expand All @@ -41,21 +41,23 @@
<span slot="right">
<HelpButton>
<p>
2022 AADF (annual average daily flow) data from <ExternalLink
AADF (annual average daily flow) data from <ExternalLink
href="https://roadtraffic.dft.gov.uk/downloads"
>
DfT road statistics
</ExternalLink>. This counts the total daily number of vehicles
traveling past a count point (in both directions) on an average day of
the year. See <ExternalLink
the year. Data from the latest year available is shown. See <ExternalLink
href="https://storage.googleapis.com/dft-statistics/road-traffic/all-traffic-data-metadata.pdf"
>
methodology
</ExternalLink> for details and caveats about the measurements.
</p>
<p>
The colors show motor vehicles AADF, not pedal cycles. Click a point for
full data.
The colors show motor vehicles AADF, not pedal cycles. The outline is
thicker when the latest data is a manual or automatic count, and thinner
when it's an estimate from previous years or nearby counters. Click a
point for full data.
</p>
<OsOglLicense />
</HelpButton>
Expand All @@ -73,7 +75,7 @@
sourceLayer={name}
paint={{
"circle-color": makeColorRamp(
["get", "motor_vehicles_2022"],
["get", "motor_vehicles"],
limits,
colorScale,
),
Expand All @@ -90,7 +92,16 @@
15,
],
"circle-stroke-color": "black",
"circle-stroke-width": 0.1,
"circle-stroke-width": [
"case",
[
"in",
["get", "method"],
["literal", ["Manual count", "Automatic counter"]],
],
1.5,
0.1,
],
}}
layout={{
visibility: show ? "visible" : "none",
Expand All @@ -102,13 +113,15 @@
<Popup let:props>
<h2>{props.location}</h2>
<p>
Total motor vehicles (2022 AADF): <b>
{props.motor_vehicles_2022.toLocaleString()}
Total motor vehicles ({props.year} AADF):
<b>
{props.motor_vehicles.toLocaleString()}
</b>
</p>
<p>
Total pedal cycles (2022 AADF): <b>
{props.pedal_cycles_2022.toLocaleString()}
Total pedal cycles ({props.year} AADF):
<b>
{props.pedal_cycles.toLocaleString()}
</b>
</p>
<p>
Expand Down

0 comments on commit 8219ae1

Please sign in to comment.