Say what each page is in the words people search with, and mark up the facts
A whole-site search audit found clean foundations and three gaps: titles without the words people search for, no structured data on trail pages, and trails that did not link to each other. - Trail titles carry the name hikers use, the abbreviation, the length and what the page offers; "GPX" only where the page has one. A new optional `common_name` field holds the name hikers use (13 records). - Descriptions are built from each record, at most 155 characters. - Place and list pages are titled for what they are; heading levels no longer jump. - Trail pages link to similar and related trails and to the lists they belong to. Every trail has at least three links from other trails. - JSON-LD on every page: a Place for each trail, breadcrumbs, item lists on list and place pages, WebSite and Organization on the home page, a fuller Dataset on the data page. - A social card per trail, a changelog feed, `lastmod` in the sitemap from record dates, `noindex` on the 404 and on raw per-trail files, a favicon and an `llms.txt` listing the data files and licences. - The "Considered and left out" page has its spacing fixed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
No files matched your search
@@ -50,8 +50,8 @@ jobs:
|
||||
with:
|
||||
python-version: "3.12"
|
||||
# Standard library only: no packages to install, and no ImageMagick.
|
||||
# web/tools/make_thumbs.py is a manual tool; web/thumbs/ is committed
|
||||
# and the build only copies those thumbnails (see web/olt/thumbs.py).
|
||||
# web/tools/make_thumbs.py and make_cards.py are manual tools; web/thumbs/ and
|
||||
# web/cards/ are committed and the build only copies them (web/olt/thumbs.py, cards.py).
|
||||
- run: python3 -m unittest discover -s web/tests
|
||||
- run: python3 web/build.py --out _site
|
||||
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
# Changelog
|
||||
|
||||
## 2026-11-16 - Search visibility: titles, descriptions, headings and links between trails
|
||||
|
||||
- Every trail page has a title in the words people search with: the name hikers use, the abbreviation, the length in miles and what the page offers, for example "Appalachian Trail (AT): 2,198 miles, map and GPX". "GPX" appears only on a page that has a GPX download, and "map" only on a page with a track. A route says it is a route. Pieces are dropped in a fixed order (the kilometres, a route's author, "map", the abbreviation, then "GPX") until the whole title fits in 65 characters. Five trails with very long names are over that, because the name alone is.
|
||||
- A new optional record field, `common_name`, holds the name hikers use where it differs from `name`, such as "Appalachian Trail" for "Appalachian National Scenic Trail". 13 records have one, each given only where the trail's holder or author uses that name on a page, and that page is the basis in the record's history entry. The trail page's heading shows the common name, with the recorded name under it as "Full name", and the search box finds it. `tools/validate.py` checks the field and `docs/schema.md` describes it.
|
||||
- Trail descriptions are built from the record: the kind, the length in miles and kilometres, the states or provinces, the usual time where a source states one, then the first sentence of the summary, in at most 155 characters. The stock "Download its GPX here." sentence is gone.
|
||||
- Place pages are titled for what people search, such as "Long Trails in Colorado: 4 Trails and 6 Routes", and each list says what it is, such as "Loop Hiking Trails: 32 Long Trail Loops". Their descriptions add the count, the shortest and the longest. The home page and the About, Sources, Logos, Data, Record schema, Changelog and left-out pages have their own titles and descriptions too, and no two pages share a description.
|
||||
- The place and list pages no longer jump from the main heading to third-level headings.
|
||||
- On the Considered and left out page, the introduction is now spaced from the first group, with the same short space above it as the other list pages.
|
||||
- Trails link to each other. The foot of each trail page now offers similar trails (close in length, alike in terrain and shape), trails whose own words name this one or share its name, and the longest trails in its state, as before. Every trail is now listed on at least three other trails' pages; 68 were on none. On a trail page, the terrain, a loop, a cross-country walk, and a length or a time that puts the trail in a list now link to that list, and each place page names the lists that hold trails there.
|
||||
- Every trail page now carries structured data (JSON-LD) built from its record: a `Place` that is also a `TouristAttraction` (schema.org has no type for a trail), with the abbreviation and common name as alternate names, the states, the extent of the track, the official page and the OpenStreetMap relation as `sameAs`, the published length in miles and kilometres, the usual time, the highest point, and the track files with their licence. A route says who its author is. The page's `dateModified` is the newest of its check dates and its history, never the build date. Nothing is marked up that the record does not hold: no rating, review, price or opening hours.
|
||||
- Every page with a breadcrumb has a `BreadcrumbList` read from the breadcrumb it shows. Place and list pages have a `CollectionPage` with an `ItemList` of their trails. The home page has `WebSite` and `Organization`, which hold only what `web/site.toml` holds. The `Dataset` is now on the data page, and is fuller: creator, keywords, spatial and temporal coverage, date modified, version, the variables, how they are measured, and each download with its format.
|
||||
- Each trail has its own social card, 1200 by 630 pixels, with its name, length, places and the outline of its track. They are drawn by `web/tools/make_cards.py` and committed in `web/cards/`, as the logo thumbnails are, so the site build stays standard library only. Every page also says what its card shows.
|
||||
- The sitemap gives each page a `<lastmod>` from the data: a trail's newest check or history date, a list or place page's newest trail, the changelog's newest entry. A page with no date of its own has none.
|
||||
- The 404 page asks not to be indexed. The raw files under `/trails/` (`trail.toml`, `release.txt`, `map.json`, `sketch.json`, the GeoJSON and the GPX) carry `X-Robots-Tag: noindex`, so a trail's page stays the one result for it. The bulk downloads under `/data/` stay indexable.
|
||||
- New: an Atom feed of this changelog at `/feed.xml`, linked from every page; links from the data page to the JSON and CSV; a `favicon.ico`; and `/llms.txt`, a plain list of the bulk files, the per-trail file names and the licences.
|
||||
- No trail's facts changed except the added common names.
|
||||
|
||||
## 2026-11-16 - A monthly refresh process for the whole dataset
|
||||
|
||||
- The monthly refresh is now written down and can be started with one command. An agent follows the runbook in `.claude/skills/refresh-trails/` (start it with `/refresh-trails`, or `/refresh-trails light` to verify and re-check only). It verifies every record against the pages it cites, re-checks `left-out.toml` and its `waiting` entries, searches for missing trails and routes by region, looks at tracks and emblems, has every proposed change reviewed by a second reader who opens the cited pages, and stops for the maintainer's ruling on borderline trails before anything is applied.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
id = "appalachian"
|
||||
name = "Appalachian National Scenic Trail"
|
||||
common_name = "Appalachian Trail"
|
||||
short_name = "AT"
|
||||
short_name_url = "https://www.nps.gov/appa/index.htm"
|
||||
country = "US"
|
||||
@@ -115,3 +116,12 @@ basis = "The emblem is shown by its holder or by the managing agency on the page
|
||||
basis_url = "https://upload.wikimedia.org/wikipedia/commons/2/24/Appalachian_Trail_Marker_Logo.svg"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-16"
|
||||
change = "The name hikers use, Appalachian Trail, was added as the common name. The recorded name is unchanged."
|
||||
fields = ["common_name"]
|
||||
basis = "The National Park Service page for the trail opens its description with 'The Appalachian Trail is a 2,190+ mile long public footpath' and also uses the formal name."
|
||||
basis_url = "https://www.nps.gov/appa/index.htm"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
id = "arizona"
|
||||
name = "Arizona National Scenic Trail"
|
||||
common_name = "Arizona Trail"
|
||||
short_name = "AZT"
|
||||
short_name_url = "https://aztrail.org/"
|
||||
country = "US"
|
||||
@@ -95,3 +96,12 @@ fields = ["record"]
|
||||
basis = "The record's own source entry: Arizona Trail Association."
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-16"
|
||||
change = "The name hikers use, Arizona Trail, was added as the common name. The recorded name is unchanged."
|
||||
fields = ["common_name"]
|
||||
basis = "The Arizona Trail Association's page is headed 'Welcome to the Arizona Trail' and uses the formal name only in its introduction."
|
||||
basis_url = "https://aztrail.org/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
id = "black-canyon"
|
||||
name = "Black Canyon National Recreation Trail"
|
||||
common_name = "Black Canyon Trail"
|
||||
country = "US"
|
||||
regions = ["AZ"]
|
||||
length_km = 129
|
||||
@@ -90,3 +91,12 @@ fields = ["record"]
|
||||
basis = "The record's own source entry: Bureau of Land Management."
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-16"
|
||||
change = "The name hikers use, Black Canyon Trail, was added as the common name. The recorded name is unchanged."
|
||||
fields = ["common_name"]
|
||||
basis = "The Bureau of Land Management page says 'The 80-mile Black Canyon Trail' and uses the formal name in its heading."
|
||||
basis_url = "https://www.blm.gov/visit/black-canyon-national-recreation-trail"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
id = "continental-divide"
|
||||
name = "Continental Divide National Scenic Trail"
|
||||
common_name = "Continental Divide Trail"
|
||||
short_name = "CDT"
|
||||
short_name_url = "https://cdtcoalition.org/"
|
||||
country = "US"
|
||||
@@ -104,3 +105,12 @@ basis = "The emblem is shown by its holder or by the managing agency on the page
|
||||
basis_url = "https://www.fs.usda.gov/sites/default/files/fs_media/fs_document/CDT_ServiceMark_Auth_Guidelines_FINAL_06282021.pdf"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-16"
|
||||
change = "The name hikers use, Continental Divide Trail, was added as the common name. The recorded name is unchanged."
|
||||
fields = ["common_name"]
|
||||
basis = "The Continental Divide Trail Coalition's page says 'the Continental Divide Trail was designated nearly 50 years ago' and gives the formal name as well."
|
||||
basis_url = "https://cdtcoalition.org/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -33,6 +33,7 @@ line_file = "line.geojson"
|
||||
| --- | --- | --- | --- |
|
||||
| `id` | string | Stable identifier. Equals the directory name. Never changes. | `"long-trail"` |
|
||||
| `name` | string | The trail's own name. | `"Long Trail (Vermont)"` |
|
||||
| `common_name` | string, where present | The name hikers use, where it differs from `name`: `"Appalachian Trail"` for `"Appalachian National Scenic Trail"`. Only where the trail's holder or author (or the agency that manages it) uses that name on a page; the page goes in the `basis_url` of the `[[history]]` entry that adds it. Never made up, and never the same as `name`. The site puts it in the page title, the heading and the search; `name` stays on the page. | `"Appalachian Trail"` |
|
||||
| `short_name` | string, where present | Abbreviation the trail's holder or author uses for it, or, failing that, one in established use among hikers. Never made up: a trail nobody abbreviates has none. Written without full stops (`"AT"`, not `"A.T."`); hyphens and digits stay as the holder writes them. Two trails may truthfully share one, and both show it. | `"LT"` |
|
||||
| `short_name_url` | string, with `short_name` | The page where the abbreviation was seen in use. Required when `short_name` is present; an error without it. An http(s) address. | `"https://www.greenmountainclub.org/"` |
|
||||
| `country` | string | `US` or `CA`. | `"US"` |
|
||||
@@ -212,7 +213,7 @@ Settling a conflict:
|
||||
- fails when an entry that was already there was changed or removed;
|
||||
- prints, for each changed fact, the earlier entries about the same field, and prints `!!` lines where an earlier entry was `declined`, or was asked for by someone other than the dataset's own check. That is where two requests may conflict: read the entry before you change the field again.
|
||||
|
||||
**Facts**, which need an entry when they change: `name`, `short_name`, `short_name_url`, `country`, `regions`, `length_km`, `length_note`, `kind`, `tier`, `designation`, `inclusion`; everything in `[source]` except the fields below, which includes the track's source, licence and permission; `osm.relation`; everything in `[shield]` except `note` (the logo); everything in `[hike]` except `summary`, `checked` and the sources (the ends, official page, days, season, terrain, travel, high point, permit, unfinished and caution); `[route]` except `note` (the author and the track policy); `[[guide]]` except the price. A replaced track file counts as a change to `source.line_file`.
|
||||
**Facts**, which need an entry when they change: `name`, `common_name`, `short_name`, `short_name_url`, `country`, `regions`, `length_km`, `length_note`, `kind`, `tier`, `designation`, `inclusion`; everything in `[source]` except the fields below, which includes the track's source, licence and permission; `osm.relation`; everything in `[shield]` except `note` (the logo); everything in `[hike]` except `summary`, `checked` and the sources (the ends, official page, days, season, terrain, travel, high point, permit, unfinished and caution); `[route]` except `note` (the author and the track policy); `[[guide]]` except the price. A replaced track file counts as a change to `source.line_file`.
|
||||
|
||||
**Not facts**, which need none: `[[history]]` itself; all of `[verification]`, which the tools refresh; `source.source_checked`, `source.discovery`, `source.format`, `source.crs`, `source.mainline` and `source.length_gap_note`; `hike.summary` (our wording), `hike.checked` and `[[hike.source]]`; `guide.price` and `guide.price_checked`; the notes `osm.note`, `shield.note` and `route.note`; `[[link]]`; `wave` and `wave_note`. A field that is in neither list is a fact. The lists are `FACTS_TEXT` and `NOT_FACTS` in `tools/trail_history.py`, and `python3 tools/check_history.py --facts` prints them.
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
id = "florida"
|
||||
name = "Florida National Scenic Trail"
|
||||
common_name = "Florida Trail"
|
||||
short_name = "FT"
|
||||
short_name_url = "https://floridatrail.org/explore-the-florida-trail/"
|
||||
country = "US"
|
||||
@@ -110,3 +111,12 @@ basis = "The emblem is shown by its holder or by the managing agency on the page
|
||||
basis_url = "http://apalachee.floridatrail.org/wp-content/uploads/2014/07/FNST-Coalition-Land-Managers-Guide-to-Minimum-Trail-Standards-and-Guidelines-for-the-FNST.pdf"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-16"
|
||||
change = "The name hikers use, Florida Trail, was added as the common name. The recorded name is unchanged."
|
||||
fields = ["common_name"]
|
||||
basis = "The Florida Trail Association's page is headed 'Explore the Florida Trail' and uses the formal name in its text."
|
||||
basis_url = "https://floridatrail.org/explore-the-florida-trail/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
id = "general-george-crook"
|
||||
name = "General George Crook National Recreation Trail"
|
||||
common_name = "General Crook Trail"
|
||||
country = "US"
|
||||
regions = ["AZ"]
|
||||
length_km = 95
|
||||
@@ -86,3 +87,12 @@ basis = "The pages named in the logo note were searched, and none shows an emble
|
||||
basis_url = "https://www.fs.usda.gov/r03/apache-sitgreaves/recreation/trails/general-crook-trail"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-16"
|
||||
change = "The name hikers use, General Crook Trail, was added as the common name. The recorded name is unchanged."
|
||||
fields = ["common_name"]
|
||||
basis = "The Forest Service page for the trail is headed 'General Crook Trail' and uses that name throughout."
|
||||
basis_url = "https://www.fs.usda.gov/r03/apache-sitgreaves/recreation/trails/general-crook-trail"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
id = "ice-age"
|
||||
name = "Ice Age National Scenic Trail"
|
||||
common_name = "Ice Age Trail"
|
||||
short_name = "IAT"
|
||||
short_name_url = "https://www.iceagetrail.org/"
|
||||
country = "US"
|
||||
@@ -103,3 +104,12 @@ basis = "The emblem is shown by its holder or by the managing agency on the page
|
||||
basis_url = "https://www.nps.gov/iatr/planyourvisit/images/Ice-Age-NST-Trailmark.png"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-16"
|
||||
change = "The name hikers use, Ice Age Trail, was added as the common name. The recorded name is unchanged."
|
||||
fields = ["common_name"]
|
||||
basis = "The Ice Age Trail Alliance's page is headed 'About the Ice Age Trail' and uses the formal name in its introduction."
|
||||
basis_url = "https://www.iceagetrail.org/explore/explore-the-trail/ice-age-trail/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
id = "new-england"
|
||||
name = "New England National Scenic Trail"
|
||||
common_name = "New England Trail"
|
||||
short_name = "NET"
|
||||
short_name_url = "https://www.nps.gov/neen/index.htm"
|
||||
country = "US"
|
||||
@@ -96,3 +97,12 @@ fields = ["record"]
|
||||
basis = "The record's own source entry: National Park Service with the Connecticut Forest & Park Association and the Appalachian Mountain Club."
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-16"
|
||||
change = "The name hikers use, New England Trail, was added as the common name. The recorded name is unchanged."
|
||||
fields = ["common_name"]
|
||||
basis = "The National Park Service page says 'the New England Trail covers 235 miles' and uses it in its mailing address."
|
||||
basis_url = "https://www.nps.gov/neen/index.htm"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
id = "north-country"
|
||||
name = "North Country National Scenic Trail"
|
||||
common_name = "North Country Trail"
|
||||
country = "US"
|
||||
regions = ["ND", "MN", "WI", "MI", "OH", "PA", "NY", "VT"]
|
||||
length_km = 7403
|
||||
@@ -103,3 +104,12 @@ basis = "The emblem is shown by its holder or by the managing agency on the page
|
||||
basis_url = "https://northcountrytrail.org/files/outreach/NCTA%20Brand%20Standards%20and%20Style%20Guide_2024.pdf"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-16"
|
||||
change = "The name hikers use, North Country Trail, was added as the common name. The recorded name is unchanged."
|
||||
fields = ["common_name"]
|
||||
basis = "The National Park Service page uses 'North Country Trail' in its captions and links, with the formal name in its title."
|
||||
basis_url = "https://www.nps.gov/noco/index.htm"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
id = "ouachita"
|
||||
name = "Ouachita National Recreation Trail"
|
||||
common_name = "Ouachita Trail"
|
||||
short_name = "OT"
|
||||
short_name_url = "https://www.friendsoftheouachita.org/about-the-ot"
|
||||
country = "US"
|
||||
@@ -95,3 +96,12 @@ basis = "The emblem is shown by its holder or by the managing agency on the page
|
||||
basis_url = "https://www.friendsoftheouachita.org/wp-content/uploads/2025/04/foot-logo.svg"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-16"
|
||||
change = "The name hikers use, Ouachita Trail, was added as the common name. The recorded name is unchanged."
|
||||
fields = ["common_name"]
|
||||
basis = "The Friends of the Ouachita Trail say: 'The 'Ouachita Trail', as it is more commonly known'."
|
||||
basis_url = "https://www.friendsoftheouachita.org/about-the-ot"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
id = "pacific-crest"
|
||||
name = "Pacific Crest National Scenic Trail"
|
||||
common_name = "Pacific Crest Trail"
|
||||
short_name = "PCT"
|
||||
short_name_url = "https://www.pcta.org/"
|
||||
country = "US"
|
||||
@@ -102,3 +103,12 @@ basis = "The emblem is shown by its holder or by the managing agency on the page
|
||||
basis_url = "https://www.fs.usda.gov/sites/nfs/files/trails/pacific-crest-nst/image/PCT%20logo.jpg"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-16"
|
||||
change = "The name hikers use, Pacific Crest Trail, was added as the common name. The recorded name is unchanged."
|
||||
fields = ["common_name"]
|
||||
basis = "The Forest Service page for the trail, which administers it, uses 'Pacific Crest Trail' in its alerts link ('Pacific Crest Trail Closures') beside the formal name."
|
||||
basis_url = "https://www.fs.usda.gov/trails/pacific-crest-nst"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
id = "pacific-northwest"
|
||||
name = "Pacific Northwest National Scenic Trail"
|
||||
common_name = "Pacific Northwest Trail"
|
||||
short_name = "PNT"
|
||||
short_name_url = "https://www.pnt.org/pnta/know-before-you-go/plan-your-trip/"
|
||||
country = "US"
|
||||
@@ -107,3 +108,12 @@ basis = "The emblem is shown by its holder or by the managing agency on the page
|
||||
basis_url = "https://pnt-prod.s3.amazonaws.com/wp-content/uploads/PNTA-Header.png"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-16"
|
||||
change = "The name hikers use, Pacific Northwest Trail, was added as the common name. The recorded name is unchanged."
|
||||
fields = ["common_name"]
|
||||
basis = "The Pacific Northwest Trail Association's page is titled 'Plan Your Trip on the Pacific Northwest Trail' and gives the formal name in its first paragraph."
|
||||
basis_url = "https://www.pnt.org/pnta/know-before-you-go/plan-your-trip/"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
id = "sheltowee-trace"
|
||||
name = "Sheltowee Trace National Recreation Trail"
|
||||
common_name = "Sheltowee Trace"
|
||||
country = "US"
|
||||
regions = ["KY", "TN"]
|
||||
length_km = 515
|
||||
@@ -98,3 +99,12 @@ basis = "The emblem is shown by its holder or by the managing agency on the page
|
||||
basis_url = "https://images.squarespace-cdn.com/content/v1/5f656f5d5a92157dd17414ac/1614824980218-WB89JT7X4L2SHLT1LK75/favicon.ico"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
|
||||
[[history]]
|
||||
date = "2026-11-16"
|
||||
change = "The name hikers use, Sheltowee Trace, was added as the common name. The recorded name is unchanged."
|
||||
fields = ["common_name"]
|
||||
basis = "The Sheltowee Trace Association's page says 'The Sheltowee Trace is home to horse riders' under a heading with the formal name."
|
||||
basis_url = "https://sheltoweetrace.org/trace"
|
||||
asked_by = "the dataset's own check"
|
||||
outcome = "applied"
|
||||
@@ -0,0 +1,45 @@
|
||||
"""Tests for the common_name check in tools/validate.py: no network, no numpy.
|
||||
|
||||
Run from the repository root:
|
||||
python3 -m unittest discover tools/tests
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
sys.dont_write_bytecode = True
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
import validate as V # noqa: E402
|
||||
import trail_history as H # noqa: E402
|
||||
|
||||
|
||||
def check(rec):
|
||||
errors = []
|
||||
V.check_common_name("t", rec, errors)
|
||||
return errors
|
||||
|
||||
|
||||
class CommonNameTest(unittest.TestCase):
|
||||
def test_none_is_valid(self):
|
||||
self.assertEqual(check({"name": "Appalachian National Scenic Trail"}), [])
|
||||
|
||||
def test_a_different_name_is_valid(self):
|
||||
self.assertEqual(check({"name": "Appalachian National Scenic Trail", "common_name": "Appalachian Trail"}), [])
|
||||
|
||||
def test_must_be_a_clean_string(self):
|
||||
for bad in ("", " ", " Appalachian Trail", "Appalachian Trail ", 7, ["AT"]):
|
||||
self.assertTrue(check({"name": "x", "common_name": bad}), repr(bad))
|
||||
|
||||
def test_must_differ_from_name(self):
|
||||
errors = check({"name": "Long Trail", "common_name": "Long Trail"})
|
||||
self.assertEqual(len(errors), 1)
|
||||
self.assertIn("repeats name", errors[0])
|
||||
|
||||
def test_is_a_field_that_needs_history(self):
|
||||
self.assertIn("common_name", H.SCHEMA_FIELDS)
|
||||
self.assertNotIn("common_name", H.NOT_FACTS)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -18,7 +18,7 @@ URL_RE = re.compile(r"^https?://[^\s/]+\S*$")
|
||||
# Every field a record can have, as the dotted path docs/schema.md uses. A history entry
|
||||
# names these. A table name on its own ("source", "hike.source") names every field in it.
|
||||
_TABLES = {
|
||||
"": ("id", "name", "short_name", "short_name_url", "country", "regions", "length_km",
|
||||
"": ("id", "name", "common_name", "short_name", "short_name_url", "country", "regions", "length_km",
|
||||
"length_note", "kind", "tier", "designation", "wave", "wave_note", "inclusion"),
|
||||
"source": ("status", "publisher", "publisher_url", "url", "discovery", "format", "crs",
|
||||
"licence", "licence_text", "permission_quote", "permission_by",
|
||||
@@ -62,7 +62,7 @@ NOT_FACTS = (
|
||||
"wave", "wave_note", # the dataset's own bookkeeping
|
||||
)
|
||||
FACTS_TEXT = (
|
||||
"name, short_name, short_name_url, country, regions, length_km, length_note, kind, tier, designation, "
|
||||
"name, common_name, short_name, short_name_url, country, regions, length_km, length_note, kind, tier, designation, "
|
||||
"inclusion; source.* (status, publisher, publisher_url, url, licence, licence_text, "
|
||||
"permission_*, attribution, osm_only, line_source, line_file, line_absent_reason, "
|
||||
"decision, decision_text, redistributable); osm.relation; shield.* except note; "
|
||||
|
||||
@@ -456,6 +456,19 @@ def check_elevation(tid, tdir, rec, errors):
|
||||
errors.append(f"{where}: source.computed must be a date (YYYY-MM-DD)")
|
||||
|
||||
|
||||
def check_common_name(tid, rec, errors):
|
||||
"""common_name is optional; where present it is the name hikers use, so it is a clean string that differs from name."""
|
||||
if "common_name" not in rec:
|
||||
return
|
||||
name = rec["common_name"]
|
||||
if not isinstance(name, str) or not name.strip():
|
||||
errors.append(f"{tid}: common_name must be a non-empty string (leave it out when name is the name hikers use)")
|
||||
elif name != name.strip():
|
||||
errors.append(f"{tid}: common_name has a leading or trailing space")
|
||||
elif name == rec.get("name"):
|
||||
errors.append(f"{tid}: common_name repeats name (leave it out when they are the same)")
|
||||
|
||||
|
||||
def check_short_name(tid, rec, errors):
|
||||
"""short_name is optional; where present it needs short_name_url, the page where it was seen in use."""
|
||||
name, url = rec.get("short_name"), rec.get("short_name_url")
|
||||
@@ -692,6 +705,7 @@ def main():
|
||||
if field not in rec or rec[field] in ("", None, []):
|
||||
errors.append(f"{tid}: missing required field {field}")
|
||||
check_short_name(tid, rec, errors)
|
||||
check_common_name(tid, rec, errors)
|
||||
if rec.get("id") != tid:
|
||||
errors.append(f"{tid}: id {rec.get('id')!r} does not match directory name")
|
||||
if rec.get("country") not in ("US", "CA"):
|
||||
|
||||
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 22 KiB |