How to rotate each feature in a feature class separately with specified degree

256
7
01-12-2021 11:53 AM
Labels (1)
swfbtucs
New Contributor

I have a polygon feature class and I need to rotate each feature around it's own centroid 13.5°. The Rotate tool in Modify Features can only rotate features around a common centroid. How about Python or Arcade?  

0 Kudos
7 Replies
DanPatterson
MVP Honored Contributor

Are you code adept?  I have a geometry class that works with arcpy that fills in the basic missing functionality

rotate_poly2.jpg


... sort of retired...
0 Kudos
swfbtucs
New Contributor

'Adept' hmm. But I'd give it a try. That's python, right?

0 Kudos
DavidPike
MVP Frequent Contributor

The post here seems o have an excellent answer from a user called BERA:

Rotating polygons by value from attribute table using ArcPy? - Geographic Information Systems Stack ...

It seems to be ready to go, except for adding a field specifying the rotation value for each feature (in this case create a new float field and set them all to 13.5 using field calculator).

You could of course modify the script and set it instead of a field in the cursor (row[1]) to a user-defined parameter for all the features.

0 Kudos
swfbtucs
New Contributor

I'll give this a try. Have to reload python and PyCharm on my computer first, had to reinstall windows a couple of weeks ago.

0 Kudos
DavidPike
MVP Frequent Contributor

You should have a python environment as part of the ArcGIS install, also the IDLE IDE.

0 Kudos
DanPatterson
MVP Honored Contributor
JosphatM
New Contributor II
0 Kudos