Skip to content

feat: calculate declination variables BM-1635#125

Draft
tawera-manaena wants to merge 11 commits intomasterfrom
feat/calculate-declination-variables
Draft

feat: calculate declination variables BM-1635#125
tawera-manaena wants to merge 11 commits intomasterfrom
feat/calculate-declination-variables

Conversation

@tawera-manaena
Copy link
Copy Markdown
Contributor

@tawera-manaena tawera-manaena commented Apr 20, 2026

This piece of work closely relates to this pull request.


Motivation

The magnetic declination panel tells map users the difference between grid north and magnetic north for this map sheet, including the rate of change over time. This is critical information for users navigating with a compass. Replicating this in QGIS ensures the panel is dynamically generated from accurate, location-specific data rather than manually authored, reducing the risk of error and the burden on cartographers.

Modifications

  • packages/

    • map/

      • src/

        • cli/

          • action.produce.ts

            Renamed the mapSheets variable to sheetCode since it only ever denotes exactly one.

        • python.runner.ts

          Updated the QGIS flatpak container to build-38 as we require the GeographicLib module.

      • Dockerfile

        Updated the QGIS flatpak container to build-38 as we require the GeographicLib module.

      • README.md

        Updated a few of the example commands to match the new Data Lake structure.

    • qgis/

      • assets/models/

        • igrf13.wmm & igrf13.wmm.cof

          Added as they are required for the magnetic_declination QGIS expression.

      • src/

        • qgis_export.py

          🚧 WORK IN PROGRESS 🚧

          Extended the existing logic to calculate the variables required to generate the magnetic declination component. This file has now since ballooned and would hugely benefit from a re-structure.


          To Do

          • The year variable needs to be parameterised to support generating historic maps. Otherwise, the current year is always assumed.

          • The convergence and project_years_for_pos_half_deg are not yet calculated code-side. The equations for these are somewhat unknown. Further clarity is required.

Verification

I attempted to run a Map Production workflow (Argo). However, I ran into an issue.

@github-actions
Copy link
Copy Markdown

Changes Summary

Total Features Changed: 0
Datasets Affected: 0
Git Diff Lines: 1

Kart Diff

Kart Diff (0 features)

Git Diff

Git Diff (1 lines)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

container build pull request container for testing

Development

Successfully merging this pull request may close these issues.

1 participant