Match ALPRs missing man_made or using multi-value surveillance:type#7
Open
resistanceisliberty wants to merge 1 commit into
Open
Match ALPRs missing man_made or using multi-value surveillance:type#7resistanceisliberty wants to merge 1 commit into
resistanceisliberty wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the ALPR camera fetch pipeline in the worker to avoid silently dropping valid OpenStreetMap ALPR features that either omit man_made=surveillance or use multi-value surveillance:type tagging. It does this by broadening both the Overpass query and the in-worker element filter to treat surveillance:type=ALPR as the defining signal.
Changes:
- Relax Overpass selection from exact
surveillance:type=ALPR+man_made=surveillanceto a regex match that findsALPRwithin;-separatedsurveillance:typevalues. - Update
transformOverpassToGeoJSONto accept multi-valuesurveillance:typeand to no longer requireman_made=surveillance.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+8
to
+9
| node["surveillance:type"~"(^|;)ALPR($|;)"](area.us); | ||
| way["surveillance:type"~"(^|;)ALPR($|;)"](area.us); |
Comment on lines
+114
to
+117
| // Only process ALPR elements. surveillance:type=ALPR is the defining tag and | ||
| // may be one of several ;-separated values; man_made=surveillance is not required. | ||
| const surveillanceTypes = (tags['surveillance:type'] ?? '').split(';').map((s) => s.trim()); | ||
| if (!surveillanceTypes.includes('ALPR')) continue; |
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.
The camera fetcher requires both
man_made=surveillanceand an exactsurveillance:type=ALPR, which silently drops two classes of valid ALPRs:surveillance:type=ALPRbut missingman_made=surveillance(~161 in the US)camera;ALPRorALPR;camera(~90)man_made=surveillanceis redundant whensurveillance:type=ALPRis present, so this drops it and matches ALPR as one of the;-separatedsurveillance:typevalues. The change is applied in both places that enforced the old rule — the Overpass query and thetransformOverpassToGeoJSONfilter. The(^|;)ALPR($|;)token boundary avoids false matches likeALPR150.