Create Declination Diagram (North Arrow) with Python

Update: An update to the World Magnetic Model (WMM) released in the year 2015 causes errors when executing the python tool available with this template. This is addressed in the recent patches for Esri Production Mapping as fixes to the Magnetic Calculator tool. Based on the installed version of Production Mapping, please download and install the latest patch from the Esri support site before using this template.

A declination diagram shows the angular relationship between grid, magnetic, and true north using a series of graphic arrows. A previous blog article on declination diagrams with ArcMap discussed what declination diagrams/north arrows are, and the different options for adding them to ArcMap.

Esri Production Mapping’s Topo North Arrow surround element (a USGS-style declination diagram) is mentioned in the blog. However, this element cannot be configured to change the diagram’s graphic appearance (such as font, arrow style, line length, color, etc.).  Many users want the ability to change the styles of their diagrams, allowing them to meet their organization’s custom graphic specifications.

The just released Create Declination Diagram Template provides you with the ability to do just that!  The provided map document has graphics that can be modified to change the look of the diagram. The Python tool updates those graphics to show the appropriate angles and values based on the current data frame extent using Production Mapping’s Magnetic Calculator geoprocessing tool.

With this Python-based approach of creating declination diagrams the graphics can be easily modified without any coding. The standard drawing tools in ArcMap can be used to make any necessary updates and the Python tool will still continue to work with the updated graphics. However, if you do want see how the magic works and/or change some of the dynamic behavior of the tool, the code is there for you to modify! All it takes is basic Python and arcpy knowledge.

Happy mapping!

This entry was posted in Cartographic Design, Defense, Mapping, Python and tagged . Bookmark the permalink.

Leave a Reply

10 Comments

  1. kdoss_guilford says:

    I followed the instructions for the template, but nothing changed/updated on the declination diagram. Can anyone help?

  2. jmsprung says:

    The declination diagram script fails for me. It appears the magnetic declination direction creates an exception…

    Magnetic Declination Angle in Decimal Degrees = None
    Annual Drift = None
    Magnetic Declination = W
    Exception: int() argument must be a string or a number, not ‘NoneType’
    Completed Script
    CreateDeclinationDiagram…
    Failed to execute
    (CreateDeclinationDiagram).

    • mphaterpekar says:

      What is the version of production mapping you have installed? From the description it sounds like you may need to install the latest patch to get the latest world magnetic model. The model was update in early 2015 and the updates were shipped with patches to production mapping subsequently.

  3. jmsprung says:

    The Production Mapping version used was 10.2; Build Number 2714

  4. jmsprung says:

    I have routed this inquiry to our help desk. I’m on a network and so cannot install this patch

  5. dri24@nau.edu says:

    Is there a version of this or a declination arrow for 10.3? It will not work in 10.3 and that is all I have access to.

    • ProductionMappingTeam says:

      An update to the World Magnetic Model (WMM) released in the year 2015 causes errors when executing the python tool available with this template. This is addressed in the recent patches for Esri Production Mapping as fixes to the Magnetic Calculator tool. Based on the installed version of Production Mapping, please download and install the latest patch from the Esri support site before using this template.

  6. nzgeocad says:

    Are there plans to update the Topo North Arrow to show the Grid to Mag angle for UTM maps? And can someone explain the requirement to use the Lambert Conformal Conic projection to generate a GRID_VARIATION value? Why not simply a UTM (WGS84) projection? (The value when using the best version for my location in UTM 60S is the ‘Asia South Lambert Conformal Conic’ projection….I’ve no idea if this is the correct one and it returns incorrect grid variations)

  7. dri24@nau.edu says:

    The code works after installing the World Magnetic Model (WMM) coefficient update 2015-2020. I am trying to use this within data driven pages along a trail and the tool doesn’t appear to change based on a different page/location. Any ideas for how to make this a dynamic element to change with each data driven page? Thanks!