Implement point-in-zone classifier tool (E03 step 4)#269
Open
Implement point-in-zone classifier tool (E03 step 4)#269
Conversation
Create feature spec and tool spec for the point-in-zone classifier, step 4 of the E03 buffer zone analysis cascade. The tool classifies MultiPoint reference coordinates against concentric detection zone polygons using ray-casting, updating per-point metadata with zone name and color for visual rendering. Includes 2 golden I/O examples (basic classification and all-outside). Links to specs/081-point-in-zone-classifier/spec.md https://claude.ai/code/session_01EWe9YQXUrUdynXavqEZUmG
Phase 0: research.md — algorithm decisions (ray-casting, no external deps) Phase 1: data-model.md, contracts/tool-contract.yaml, quickstart.md Phase 1: plan.md with constitution check (all pass), project structure Phase 2: media/planning-post.md, media/linkedin-planning.md All constitution gates pass. No new technologies introduced. https://claude.ai/code/session_01EWe9YQXUrUdynXavqEZUmG
Python and TypeScript implementations of the point-in-zone classifier, step 4 of the E03 buffer zone analysis chain. Classifies MultiPoint reference coordinates against concentric detection zone polygons using ray-casting algorithm with innermost-first zone priority. Changes: - Python: services/calc/debrief_calc/tools/reference/classification.py - TypeScript: apps/vscode/src/tools/reference/classification/ - Registration: Python @tool, web-shell Map, VS Code barrel - Tests: 22 Python tests (all passing), golden example validation - Evidence: test-summary.md, usage-example.md - Media: shipped-post.md, linkedin-shipped.md Zero external dependencies. Stdlib only in both languages. https://claude.ai/code/session_01EWe9YQXUrUdynXavqEZUmG
🚀 Preview DeploymentsWeb Shell (Standalone App)Use this for Playwright testing and demos - runs outside Storybook. Storybook (Component Library)Browse all components, stories, and documentation. All Links
|
Remove unused ToolParameter import, add strict=True to zip() calls, rename unused loop variable e to _e. https://claude.ai/code/session_01EWe9YQXUrUdynXavqEZUmG
Display truncated feature ID (first 8 chars) in the info area of each feature row. Helps diagnose duplicate ID issues when multiple features of the same type appear selected. https://claude.ai/code/session_01EWe9YQXUrUdynXavqEZUmG
Adds a circled-i icon button on each feature row (visible on hover). Clicking it shows an alert dialog listing all feature properties including the feature ID, kind, geometry type, etc. Helps diagnose duplicate ID issues. https://claude.ai/code/session_01EWe9YQXUrUdynXavqEZUmG
Clicking the info text on a FeatureRow now opens an alert dialog showing the full feature id plus all properties and geometry type. Removes redundant separate info-icon button. https://claude.ai/code/session_01EWe9YQXUrUdynXavqEZUmG
Adds a Leaflet bindPopup to onEachFeature that displays feature.id as the first line, followed by scalar properties and geometry type. This helps diagnose a suspected duplicate ID issue when selecting reference points and detection zone features together. https://claude.ai/code/session_01EWe9YQXUrUdynXavqEZUmG
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.
Summary
Implement the point-in-zone classifier tool — step 4 of the E03 buffer zone analysis chain. This tool classifies reference points by testing each coordinate against concentric detection zone polygons using a ray-casting point-in-polygon algorithm, then updates per-point metadata with zone assignment and color.
Key Changes
Specification & Documentation
specs/081-point-in-zone-classifier/spec.mdwith 3 user stories and 14 functional requirementsshared/tools/reference/classification/point-in-zone-classifier.1.0.mdcovering algorithm, inputs, outputs, and annotationsPython Implementation
services/calc/debrief_calc/tools/reference/classification.py— core tool implementation with:_point_in_polygon(): Ray-casting algorithm for point-in-polygon testingpoint_in_zone_classifier(): Main classifier function registered via@tooldecorator withContextType.MULTIzoneandcolorfieldspointColorsarray generation for per-point renderingservices/calc/debrief_calc/tools/reference/__init__.pyandservices/calc/debrief_calc/tools/__init__.pyTypeScript Implementation
apps/vscode/src/tools/reference/classification/pointInZoneClassifier.ts— identical algorithm in TypeScript with:apps/vscode/src/tools/reference/classification/index.tsapps/web-shell/src/services/toolService.tsComprehensive Test Suite
services/calc/tests/tools/reference/test_classification.py— 22 tests covering:Implementation Details
zoneandcolorstyle.fill_color(preferred) orstyle.color; defaults to#666666for points outside all zonesAll 22 tests passing. Zero external dependencies. Ready for integration with generate-reference-points (#78) and buffer-zone-generator (#80).
https://claude.ai/code/session_01EWe9YQXUrUdynXavqEZUmG