Skip to content

Implement canonical MapLibre style pipeline across protocols #244

@mikemcdougall

Description

@mikemcdougall

Background

MVP docs call for MapLibre Style Spec v8 as the canonical layer style, edited via embedded Maputnik, and converted to GeoServices drawingInfo for FeatureServer responses (see docs/ARCHITECTURE.md Styling section and docs/adr/0002-maplibre-canonical-style.md). Current style endpoints are placeholders and do not persist or translate styles.

Scope

Implement the canonical MapLibre style pipeline so a single style edited in Maputnik drives FeatureServer and OGC metadata outputs.

Acceptance Criteria

  • DB: layers has maplibre_style JSONB (canonical), geoservices_drawing_info JSONB (cache/import), and style_version INT (migration added if missing).
  • Admin metadata style endpoints:
    • GET /api/v1/admin/metadata/layers/{layerId}/style returns stored MapLibre style and GeoServices drawingInfo (converted if cache empty).
    • PUT validates MapLibre v8, saves maplibre_style, increments style_version, clears cached geoservices_drawing_info, and returns updated style payload.
    • If request includes only drawingInfo, server converts to MapLibre and stores MapLibre as canonical (import/compat path).
  • FeatureServer layer metadata includes drawingInfo derived from MapLibre when cache is empty, then cached for future requests.
  • OGC API Features collection metadata exposes a style link to the public MapLibre style endpoint (see TileJSON metadata endpoint #20).
  • Converters:
    • Support Simple/UniqueValue/ClassBreaks renderers (MapLibre <-> GeoServices).
    • Unsupported renderer types fall back to a sensible default and emit a warning log.
  • Cache invalidation on style update (layer metadata + output cache tags).
  • Tests cover: style save/load, conversion for each renderer type, and FeatureServer metadata includes drawingInfo.

Dependencies

Out of Scope

  • OGC API Styles CRUD endpoints (planned post-MVP)
  • Advanced GeoServices renderers (heatmap, dot density, picture symbols, temporal)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions