# Rotating fishnet made of minimum bounding boxes?

Given a grid of points, I had to create something similar to a fishnet, and did so using the buffer -> minimum bounding geometry option as listed here (option A).

Since my grid comes from Climate Models, it is rotated (alpha=15.16 degrees counterclockwise). The fishnet obtained has no such rotation, however, and I need to rotate it by the same alpha angle.

My fishnet has `170090` individual objects (466 columns and 365 rows), and this is because each square had to inherit an `order` field from the point it contains, so I have not dissolved the squares into a unique object.

How can I rotate all my squares by alpha?

Each square has to rotate relative to its center.

Image:

• Please include the steps that you used to create your fishnet within your question. Potential answerers may or, in my case, may not be willing to follow a link to try and synthesize your question. Doesn't your question distil to "How do I rotate a square polygon by alpha using ArcPy?" Once you can do it for one automating it to cursor through your feature class to do the remainder should be straightforward.
– PolyGeo
Commented Feb 3, 2017 at 9:23
• Please don't use the term "fishnet" to refer to a sparse pattern of polygons. A fishnet could be created to contain your systematic sampling pattern, but it is not a fishnet in of itself. Commented Feb 3, 2017 at 12:13
• @Vince this only looks like a sparse pattern of polygons. There was no point in showing all `170k +` of them. I get it it might not be an ortodox fishnet, but this is what it is at the core of my population of squares, where the latter reproduce the Moore neighborhood. Commented Feb 3, 2017 at 13:11
• Fishnets are mutually exclusive, exhaustively complete partitions of space. What you have is a rotated, regularly distributed, systematic sampling scheme. You actually showed too many features, since the graphic wasn't legible on a 5-inch screen. Commented Feb 3, 2017 at 14:07

Script below will create a new polygon feature class with features rotated counterclockwise around centroid.

``````import arcpy,math
arcpy.env.overwriteOutput=1
original_fc=r'C:\TEST.gdb\unrotatedPolygons'
copied_fc=r'C:\TEST.gdb\rotatedPolygons'
arcpy.CopyFeatures_management(in_features=original_fc, out_feature_class=copied_fc)
rotation=15.16 #counterclockwise rotation in degrees
with arcpy.da.UpdateCursor(copied_fc,'SHAPE@') as cursor:
for row in cursor:
array1=row[0].getPart()
centroid=(row[0].centroid.X,row[0].centroid.Y)
for vertice in range(row[0].pointCount):
pnt=array1.getObject(0).getObject(vertice)