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

2138
9
01-12-2021 11:53 AM
swfbtucs
New Contributor III

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
9 Replies
DanPatterson
MVP Esteemed 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 III

'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 III

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 Esteemed Contributor
raisya_samsudin
New Contributor

Hi Don,

 

I tried to import your Alter Geometry - Rotate Features into my model builder to rotate my grid but, I got this error.

Error 1.JPGModel Builder.JPG

0 Kudos
JosphatM
New Contributor II
RMu
by
New Contributor

OP asked about rotating each polygon about its own centroid, not a group centroid. Personally I export a shapefile to Microstation, rotate, then reimport. But it's a pain and attributes are lost.

0 Kudos