Skip to content

feat: import barrier lines into the fence layer - #5

Merged
neovolgan merged 2 commits into
claude/fence-linesfrom
claude/fence-import
Oct 16, 2026
Merged

neovolgan merged 2 commits into
claude/fence-linesfrom
claude/fence-import

Conversation

@neovolgan

Copy link
Copy Markdown
Collaborator

Importer side of contract section 4 (#2). This PR is stacked on #4 (fence layer), which is stacked on #3.

What it does

  • barrier=fence|wall|city_wall|retaining_wall lines and closed ways from GeoJSON or OSM become FenceLines.
  • Shape: the projected path is walked along cell edges by FenceStaircase. Straight runs stay single segments. A diagonal becomes a staircase that follows it (the test checks it stays within 1.5 tiles), and a step straight back cancels the previous one.
  • Look: pz:fence picks a style that exists in the map. Otherwise fence_type picks one of four vanilla looks: sheet, planks, picket or wire. Only the defaults actually used are added to FenceStyles. pz:posts sets the post spacing.
  • Gates:
    • pz:gates (at in metres along the source line, opens left/right, style) places a gate on the edge nearest that point;
    • barrier=gate nodes within a tile of a fence become a vanilla wooden wicket on the nearest edge;
    • gates that cannot be placed are dropped and counted in the import notes.
  • Source: the real lon/lat path, source ID and tags are kept.
  • Preserve edits: authored fences stay and sourced fences are refreshed, not duplicated.
  • Limits: lines outside the map or beyond the limits are counted in the import summary note.

Tests: a new case in FenceLineTests covers:

  • staircase shape;
  • styles from fence_type and defaults (including an unknown pz:fence);
  • the post spacing;
  • pz:gates and a barrier=gate node landing on the right edges;
  • the vanilla wicket drawn by the composer;
  • the kept source path;
  • reimport with Preserve edits.

Results: core 344/344 passed, npm test 184/184 passed.


Generated by Claude Code

barrier=fence|wall paths (GeoJSON or OSM) become fence lines: the
projected path is walked along cell edges (a diagonal becomes a
staircase close to it), pz:fence selects a style or fence_type a
vanilla look, pz:posts sets the post spacing, pz:gates (metres along
the source line) and barrier=gate nodes on the line become gates. Only
the default styles actually used are added; the real lon/lat path is
kept. Preserve edits keeps authored fences and refreshes sourced ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ECCGjSrSADcjxBmXdCBpm
@neovolgan
neovolgan added this pull request to stack #7 October 16, 2026 21:14
@neovolgan
neovolgan merged commit 81d162e into develop Oct 16, 2026
1 check passed
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.

2 participants