Select to view content in your preferred language

Add a rotate features method to arcpy allowing the angle and pivot coords to be specified

535
2
09-06-2023 11:51 PM
Status: In Product Plan
MattHowe
Occasional Contributor

I'm currently using geopandas to iterate through individual features in ArcGIS Pro and rotate them. It would be great if a method was added to arcpy where features could be rotated easily by specifying an angle, and a pivot point as a coordinate pair/tuple/point features. Something like:

 

arcpy.edit.Rotate(in_features, angle, origin, radians)

Example:

import arcpy
arcpy.env.workspace = "C:/data"

arcpy.MakeFeatureLayer_management("platforms.shp", "platforms_lyr", whereclause="WTG_ID = 'AB01'")

arcpy.edit.Rotate("platforms_lyr", 30, (123456.1, 5465646.10), radians=False)

# Else, use list comp and search cursors to grab the angles and coordinates of each row in the attributes.

 

With cursors, the angle and origin coordinates could be derived from a field in the in_features or hard coded etc.

 

2 Comments
DuncanHornby

In the Arcpro 3.3 release they added to geometry objects scale and move, so lets hope they add rotate to a geometries list of methods.

HannesZiegler
Status changed to: In Product Plan

We're working on this!  This status does not guarantee that the functionality will be in the next release, but development work has begun. Release cycles vary by product so make sure to check the product life cycle information to get an idea of when to expect the next release.