Skip to content

feat(schemas): add GeoJSON styling properties schemas#59

Merged
IanMayo merged 1 commit intomainfrom
implement-014-geojson-styling-schemas
Jan 20, 2026
Merged

feat(schemas): add GeoJSON styling properties schemas#59
IanMayo merged 1 commit intomainfrom
implement-014-geojson-styling-schemas

Conversation

@IanMayo
Copy link
Member

@IanMayo IanMayo commented Jan 20, 2026

Summary

  • Add standardized styling schemas (PointProperties, LineProperties, PolygonProperties, TrackStyle) following Leaflet Path options naming conventions
  • Update all feature schemas with required style property (TrackFeature, ReferenceLocation, 6 annotation types)
  • Remove deprecated color attribute from all feature schemas
  • Add 45 golden fixtures (24 valid, 21 invalid) for comprehensive validation testing

Changes

Phase 1: Setup

  • Added PointShapeEnum, LineCapEnum, LineJoinEnum to common.yaml
  • Created styling.yaml module with all styling schemas
  • Updated debrief.yaml to import styling module

Phase 2: Foundation - Styling Schemas

  • Defined PointProperties schema with shape, radius, fill, stroke properties
  • Defined LineProperties schema with stroke, color, weight, opacity, dash pattern properties
  • Defined PolygonProperties schema combining fill and stroke properties
  • Defined TrackStyle composite schema with line (LineProperties) and point (PointProperties)
  • Created 13 styling fixtures (valid + invalid)

Phase 3: TrackFeature Styling

  • Updated TrackProperties with required style: TrackStyle property
  • Removed deprecated color attribute
  • Updated track feature fixtures with style property

Phase 4: All Feature Schemas

  • Updated ReferenceLocationProperties with style: PointProperties
  • Updated all 6 annotation Properties classes with appropriate style schemas:
    • NarrativeEntry, TextAnnotation → PointProperties
    • CircleAnnotation, RectangleAnnotation → PolygonProperties
    • LineAnnotation, VectorAnnotation → LineProperties
  • Updated all feature fixtures with style property

Phase 5: Round-Trip Tests

  • Added styling schemas to ROUNDTRIP_ENTITY_MAP in test_roundtrip.py
  • Verified data preservation across Python → JSON → Python serialization

Phase 6: Tactical Styling

  • Added tactical styling fixtures (dashed lines, triangle markers)
  • Verified CSS color format support (hex, rgb, rgba, hsl, named)

Evidence

Test Results

Test File Tests Status
test_golden.py 48 PASSED
test_roundtrip.py 56 PASSED
test_schema_compare.py 15 PASSED
======================= 119 passed, 6 warnings =======================

6 warnings are expected due to known LinkML nested array limitation with GeoJSON coordinates.

Fixture Coverage

Schema Valid Fixtures Invalid Fixtures
PointProperties 4 3
LineProperties 4 3
PolygonProperties 3 3
TrackStyle 2 1

Usage Example

from debrief_schemas import TrackStyle, LineProperties, PointProperties

track_style = TrackStyle(
    line=LineProperties(
        stroke=True,
        color="#0066CC",
        weight=2,
        opacity=1.0,
        line_cap="round",
        line_join="round"
    ),
    point=PointProperties(
        shape="circle",
        radius=4,
        fill=True,
        fill_color="#0066CC",
        fill_opacity=1.0,
        stroke=True,
        color="#FFFFFF",
        weight=1,
        opacity=1.0
    )
)

Test Plan

  • All 119 tests pass (golden fixtures, round-trip, schema comparison)
  • Valid fixtures pass Pydantic validation
  • Invalid fixtures correctly fail validation with expected errors
  • Round-trip serialization preserves all styling data
  • Generated Pydantic models, JSON Schema, and TypeScript types are valid
  • All 3 point shapes (circle, square, triangle) validate correctly
  • CSS color formats (hex, rgb, rgba, hsl, named) validate correctly
  • Dash array patterns validate as strings

Related

  • Spec: specs/014-geojson-styling-schemas/spec.md
  • Tasks: specs/014-geojson-styling-schemas/tasks.md
  • Evidence: specs/014-geojson-styling-schemas/evidence/

🤖 Generated with Claude Code

Add standardized styling schemas to GeoJSON features following Leaflet
Path options naming conventions:

- Add PointProperties, LineProperties, PolygonProperties schemas
- Add TrackStyle composite schema for track line + position markers
- Add PointShapeEnum, LineCapEnum, LineJoinEnum to common.yaml
- Update all feature schemas with required `style` property:
  - TrackFeature uses TrackStyle
  - ReferenceLocation uses PointProperties
  - NarrativeEntry, TextAnnotation use PointProperties
  - CircleAnnotation, RectangleAnnotation use PolygonProperties
  - LineAnnotation, VectorAnnotation use LineProperties
- Remove deprecated `color` attribute from all feature schemas
- Add 24 valid + 21 invalid golden fixtures for validation testing
- Regenerate Pydantic models, JSON Schema, and TypeScript types
- 119 tests passing (golden, roundtrip, schema comparison)

Closes #58

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@IanMayo IanMayo merged commit e6420f6 into main Jan 20, 2026
4 checks passed
@IanMayo IanMayo deleted the implement-014-geojson-styling-schemas branch January 20, 2026 23:25
IanMayo pushed a commit that referenced this pull request Jan 23, 2026
- Update BACKLOG.md to show 014 as complete (strikethrough)
- Mark T085 as complete in tasks.md
- Implementation was already merged via PR #59

https://claude.ai/code/session_017N7izYCQVoDP4mJ3W8Ko4c
IanMayo pushed a commit that referenced this pull request Feb 7, 2026
Batch addition of language-neutral tool specs for provenance-ready
operations:
- #56 Move shape (direction + distance, default East/5km)
- #57 Enlarge shape (origin + scale, default centroid/3x)
- #58 Flip shape horizontal
- #59 Flip shape vertical
- #60 Resample track (interval, default 1 min)
- #61 Generate courses and speeds for track

All follow #49 tool documentation model. Approved — extend calc
tool library and enable scientist self-service.

https://claude.ai/code/session_01G2imkCCcHUWD5SiDMH9E7M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant