Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update vehicle counts layer to show all years and emphasize data source #485

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading