Repository navigation
Count named trail paths as hikes where trails aren't mapped as hiking routes - #99
Merged
Merged
Conversation
… routes Across the American West, trails are mostly mapped as named paths rather than hiking route relations, so searches found few hikes. The tiles query now also lists named footpaths, bridleways, and paths that aren't sidewalks, crossings, private, or part of a hiking route, with their nodes, and each set of ways of one name joined at a node is a route, with the negative of its first way's id. A picked path's details are measured from its ways, its highlights found along them, and its OpenStreetMap link goes to its first way. Paths are half a point less promising than mapped hiking routes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ross tile edges whole Where named paths would take a tile query over 8 MB, as around Zürich, the tiles are queried again for their hiking routes alone, and a response that large isn't asked of the other instance. Paths are listed 0.05° beyond their tiles, pieces of one trail from different tiles are joined where they share a way, and a path measured from fewer of its ways than a search knows is measured again from them all. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…its pieces across all tiles Measuring a path again from ways its tiles list now keeps what was measured when that fails, as Overpass does from the server, and doesn't try again for 6 hours. Details list the ways a path was measured from, those gone since too, so they aren't asked for again and again. Pieces from the first four tiles and the rest are joined too, keeping the id of a piece already checked. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This is the second step of the plan you chose ("buses and ferries …, then hikes from named trail paths"). Searches only used OpenStreetMap hiking-route relations, but across the American West most trails are mapped as named paths, with no relation:
How
OverpassService::PATH_FILTER). It skips sidewalks, crossings, private paths and ways that belong to a hiking route (- .routed).LONG_QUERY_SECONDSand the query timeout go from 45/40 to 60.path_candidates). Each trail is a candidate with the negative of its first way's id, which no relation can have, plus itsways.TILE_KEYis bumped to v3.PATH_PROMISE), so places rich in relations change little.TrailsService::Search#knownremembers each candidate path's ways, andtrails_for/routes/fetch_routestakepaths:.way(id:…)->.named; out tags geom) together with relations. It measures length, loop, a loose-end start, the preview and the paved share (path_attributes), and storeswaysin the details.path_ways), so the hike page works too.Trail#osm_urlpoints to/way/<first way>for paths. The hike page accepts negative route ids.ways.Verified locally (live providers, Overpass mirror)
Tests
wayskept./way/5link); a route id of 0 is rejected.trails_for.