← Back to Pull requests

BUG: Fix CF axis of Cartesian axes not named Easting in cs_to_cf #1658

Open
unknown opened this pull request with 269 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 15, 2026 05:35 UTC
Author

  • Closes #xxxx

  • - [x] Tests added
    - [x] Fully documented, including history.rst for all changes and api/*.rst for new API

    CoordinateSystem.to_cf() (used by CRS.cs_to_cf()) only mapped an axis named exactly "Easting" to X. Every other Cartesian axis became Y, including vertical axes:

    | CRS | Axes | Before | After |
    |---|---|---|---|
    | EPSG:2046 (Hartebeesthoek94 / Lo15) | Westing, Southing | Y, Y | X, Y |
    | EPSG:5800 (Astra Minas Grid) | First local axis (north), Second local axis (west) | Y, Y | Y, X |
    | +proj=topocentric ... | topocentric East, North, Up | X, Y, Y | X, Y, Z |
    | Engineering CRS (ship) | Forward, Starboard, Platform Down | Y, Y, Y | X, Y, Z |

    The CF axis is now determined from:
    1. the axis direction for vertical axes: up/down → Z with positive set to the direction. standard_name is not set as the height reference is not known;
    2. the axis name: east/west → X, north/south → Y. The name is checked before the direction because the direction is not east/north for some axes. For example, both axes of polar stereographic EPSG:3413 point south; EPSG:3413 is tested to keep that order;
    3. the axis direction: east/west → X, north/south → Y;
    4. when there are exactly two horizontal axes, any remaining one in order (e.g. "Forward"/"Starboard").

    CRSs that were already correct (e.g. UTM, NZTM with northing first, polar stereographic) are unchanged.

    Geocentric CRSs are also unchanged and still return Y for all three axes. I don't know of a CF standard name for geocentric axes, so I left that out of this PR.

    Testing


  • New tests for EPSG:32631, 2193, 2046, 3413, 5800, a topocentric CRS, and engineering CRSs with Forward/Starboard (2D) and Forward/Starboard/Platform Down (3D) axes. The 2046, 5800, topocentric and Forward/Starboard cases fail on main.

  • Full test suite passes locally (PROJ 9.8.1, network tests excluded).
  • AI disclosure


    I used an AI coding assistant (Claude Code) to help write this change and description. I reviewed the code and test results before opening the PR.

    🤖 Generated with Claude Code

    Diff: 269 lines (+201 / -68) across 3 files Reviewer: djhoese Review duration: 71254m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.46) × (1 − Review Confidence (0.41)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.46 · 269 lines diff across 3 files
    0.46
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    40%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.335
    Real PR Conversation Timeline
    1 comments
    "Review active on #1658"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 40.9% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 46.4% (MEDIUM) · Higher = larger blast radius
    46.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 40.9% · Lower = rushed or shallow review
    40.9%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 27.4% · Safe to merge
    27.4%
    Repository