Repository navigation
Expose hov:lanes and hov:minimum as raw text - #139
Open
dsaderholm wants to merge 1 commit into
Open
dsaderholm wants to merge 1 commit into
dsaderholm wants to merge 1 commit into
Conversation
Closes pfeiferj#130. Both are passed through untouched, the same shape as maxSpeedConditional: read in the generator, stored on the offline Way, memoized on maps.Way and published on MapdOut. Whether an HOV lane may be used depends on occupancy, tolling and local rules mapd does not model, so consumers evaluate the tag themselves rather than mapd indexing lanes. Two fields rather than the directional variants. hov:lanes is 19,596 objects worldwide and hov:minimum 11,419, while hov:lanes:forward and hov:lanes:backward are 216 and 252 -- about 1% -- so carrying them would cost every tile two more Text fields for almost nothing. hov:lanes:conditional (1,207) is left out for the same reason. Where the tag exists the HOV lane is the leftmost one: "designated" is the first entry on all 573 tagged ways sampled on I-15 in Utah, and the pipe count always matches lanes. Coverage is regional, and the docs say so. It is a US and Canada tag, and it only describes roads where the HOV lane is a lane of the main carriageway. In California the HOV lane is usually mapped as its own carriageway, so the matched way carries no hov:lanes and the field is correctly empty there. Adding the fields at the end of both structs keeps old tiles readable -- a way written before this reads empty rather than failing. Verified: capnp regenerated with capnp 1.3.0 and capnpc-go v3.1.0-alpha.1, which reproduce the committed .capnp.go byte for byte on the unmodified schemas before this change. The generated diff is the two accessor sets, the MapdOut pointer count 6 -> 8, and the embedded schema blob. go build, go vet and go test could not be run locally: gomsgq needs linux and cgo, and this was written on Windows. CI covers all three. Co-Authored-By: Claude Opus 5 <noreply@anthropic.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.
Closes #130. Entirely reasonable to close this instead if it is not worth the maintenance — the coverage numbers below are regional and I said in the issue I would put it behind the
overtakingwork.What it does
Passes
hov:lanesandhov:minimumthrough untouched, in the same shape asmaxSpeedConditional: read in the generator, stored on the offlineWay, memoized onmaps.Way, published onMapdOut. No lane indexing and no occupancy logic in mapd — whether an HOV lane may be used depends on occupancy, tolling and local rules, so consumers evaluate the tag themselves.Two fields, not the directional variants
From taginfo:
The forward/backward forms are about 1% of
hov:lanes, so carrying them would cost every tile two more Text fields for almost nothing. Left them out, andhov:lanes:conditionaltoo. Happy to add them if you would rather be symmetric with the maxspeed handling.Format and coverage
Where the tag exists the HOV lane is the leftmost one —
designatedis the first entry on all 573 tagged ways I sampled on I-15 in Utah, and the pipe count always matcheslanes.The California zero is not missing data: there the HOV lane is mapped as its own carriageway, so the matched way genuinely has no
hov:lanesand the field is correctly empty.docs/outputs.mdsays so, since it would otherwise look like a bug.Compatibility
Both fields are appended at the end of their structs, so tiles written before this read empty rather than failing.
MapdOut's pointer count goes 6 → 8, which is the normal additive change.Verification, including what I could not run
capnp1.3.0 withcapnpc-gov3.1.0-alpha.1. Before making any change I regenerated both schemas unmodified and confirmed a zero diff against the committed.capnp.go, so the generated output here is byte-comparable with yours rather than reformatted by a different toolchain version. The generated diff is the two accessor sets, the pointer count, and the embedded schema blob.go build,go vetandgo testwere not run locally —gomsgqneeds linux and cgo, and I wrote this on Windows. I verified by inspection that every generated symbol the hand-written code calls exists with the expected signature, and that thestate.gocall is the same shape as theSetRoadNameline above it. CI covers the rest, and I will fix anything it finds.I did not run
gofumpt -w: with the current release it wants to rewrite files this PR does not touch, and I did not want to bury the change.No test added, matching the existing conditional-tag accessors, which are also untested — the parser has tests because there is something to parse, and the point of this one is that there is not.
Happy to test a build on device.
🤖 Generated with Claude Code