Calculating index rotation angle

Posted by in ArcMap, GIS, Mapbook

You’ve built your index layer and it might look something like this.

01

If you’ve rotated these features manually and want to used them to control page rotation in data driven pages, you’ll need a field containing the page rotation value.

This layer already has an angle field that I’m going to use to demonstrate how to calculate an angle that will play nice with data driven pages.

Search for the Calculate Polygon Main Angle (Cartography) Tool. Drop in the index feature in the input features spot, assign the angle field and choose the rotation method, choose geographic – this is how the data frame is rotated. Here’s a quick illustration of the different rotation methods.

GR-02

A -45 degree geographic rotation points north 45 degrees toward the east, or rotates north 45 degrees clockwise.

In the illustration below you can see that a -45 degree (or 315 degree) geographic rotation, the blue line on the left when rotated north, points true north 45 degrees clockwise.

GR-05

When I run the tool, I get negative fractional angles. I don’t want either. I want positive integers. As a rule of thumb your index layer, if controlling data frame rotation through data driven pages, should contain positive integers. When map symbology and labeling gets intricate and detailed, negative fractional rotation values will do very strange things to your map exports.

So, at this point I have these angles.

Rev01

To convert these to acceptable values, I’ll first calculate the Angle field with the following python expression

int( !Angle!)

Here’s the Field Calculator.

04

So now I’ve got integers.

Rev02

Select the negative values, in Select by Attributes select values less than 0.

"Angle"<0

Now calculate the negative values with this expression (python).

360+!Angle!

Now your set with an angle that will play nice with data driven pages and complicated symbology and labeling.

Rev03

 

1 Comment

  1. Hemerson
    January 13, 2019

    Hi Brian, very thanks for your help, I have a comment, in the last point 360+!Angle!, it’s depends for the quadrant where the long side appears for the geometry, 0-90, 90-180, 180-270 and 270-360, for example, I have a polygon with -35.94 main angle, it´s long side appears in the first quadrant (0-90), the subtract is 90+(-35.94)= 54.06°

    Reply

Leave a Reply