Skip to content

Commit d276739

Browse files
author
Andy Townsend
committed
Detect Core Paths in Scotland
which only have "Core Path..." set in the `ref`.
1 parent a313164 commit d276739

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This page describes changes made in these projects: [SomeoneElse-style](https://
1111
(raster, vector) Handle more semicolon values. Apart from some special cases, shops with semicolon values just use the first part.
1212
(raster) Show access=no and access=destination on roads shown as unpaved (no change needed to vector - that was already OK)
1313
(raster, vector) Change squiggly brackets at the start of appended bridge refs to round brackets.
14+
(raster, vector) Detect Core Paths in Scotland which only have "Core Path..." set in the `ref`.
1415

1516
## 03/07/2025
1617
(raster, vector) Show `wheelchair` flash on `amenity=fast_food` with `cuisine=kebab`, `cuisine=mexican` and synonyms.

shared_lua.lua

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,30 @@ function consolidate_lua_01_t( passedt )
504504
passedt.trail_visibility = "intermediate"
505505
end
506506

507+
-- ----------------------------------------------------------------------------
508+
-- Core path numbers in Scotland are often stored in "ref" as "Core Path XXX"
509+
-- rather than as prow_ref as elsewhere.
510+
--
511+
-- For a highway with a ref, if designation and prow_ref are unset, and
512+
-- if the ref starts with "Core Path", then set the designation to "core_path"
513+
-- and set prow_ref.
514+
--
515+
-- This lifts the path out of e.g. the low visibility check below.
516+
-- ----------------------------------------------------------------------------
517+
if (( passedt.ref ~= nil ) and
518+
( passedt.highway ~= nil ) and
519+
( passedt.highway ~= "" ) and
520+
(( passedt.designation == nil ) or
521+
( passedt.designation == "" ) or
522+
( passedt.designation == "core_path" )) and
523+
(( passedt.prow_ref == nil ) or
524+
( passedt.prow_ref == "" )) and
525+
( string.find( passedt.ref, "Core Path", 1, true ))) then
526+
passedt.designation = "core_path"
527+
passedt.prow_ref = passedt.ref
528+
passedt.ref = nil
529+
end
530+
507531
-- ----------------------------------------------------------------------------
508532
-- Suppress non-designated very low-visibility paths
509533
-- Various low-visibility trail_visibility values have been set to "bad" above

0 commit comments

Comments
 (0)