Select to view content in your preferred language

how do you calculate rotation angle for data driven pages

16012
13
10-04-2011 09:52 AM
KarlKeough
Deactivated User
I am using data driven pages with a pre-defined strip map grid. I would like to add the required rotation angle to an attribute field in my index layer. I can't find a way to make this work. I've tried the Calculate Grid Convergence Angle tool but this gives values that don't make sense (all values appear to be between -2 and 2, when the real rotation is far greater than that in most cases). I can make this work if I use the program to create the strip map grid, but not if I use an existing grid layer.
Tags (2)
0 Kudos
13 Replies
JohnUrbano1
New Contributor

So, Darren's script was originally setup for rectangles, but it looks like your version will work with polygons of any number or vertices. Is that correct?

Secondly, I am not an advanced user and have generally always stayed within the confines of the cookie cutter tools in Arcmap. I don't know how to implement a script in Arcmap. Can anyone refer me to a good thread or link on how to do this so I can actually use this thing?

Thanks All - what a great community this is.

Cheers!

John

0 Kudos
HayleyHume-Merry
Occasional Contributor

Just letting you know there is a typo in your script on Line 15, this causes it to fail instantly.

Also, I kept getting an error on Line 22, float division by zero (tan = - dy/dx). I didn't have time to look into it so I used the script posted by Darren in the end. It may be specific to my input, I'm not sure.

0 Kudos
Jack_Zhang
Frequent Contributor

Thanks Hayley Hume-Merry‌ pointed out the typo. also John Urbano I just saw your message today. the script only works for 4 point rectangle. However, FYI since then I have been using Minimum Bounding Geometry (by width) tool to work out the rotation angle of polygon of any shape. Just make sure you enabled the Add geometry characteristics as attributes to output option at the bottom of the tool. The output features include a field called MBG_Orientation, which is the orientation of the longer side of the resulting rectangle. I could then derive the rotation angel depends on if the data drive page layout is portrait or landscape.

0 Kudos
jireland_pickett
New Contributor

Still having this issue in July of 2023. Does anyone else have a better solution? The only work around I came up with is after you rotate the strip index polygons, then draw a line snapping to mid point of each polygon, then rerun the strip index tool with 0 overlap, and if necessary do a spatial join with the newly created polygons and field calculate the angle field if you want to update your original strip index polygons.

0 Kudos