I have a feature class that contains all attributes of a given raster dataset. I need to rotate the raster dataset about the center of the raster. I have the center x and y values and need to create the pivot point from these values.
Solved! Go to Solution.
I assume you've found the Rotate tool and want to use the optional pivot point parameter. Doesn't it work to type in the xy values you want to use?
edit: I'm not sure what this means: "I have a feature class that contains all attributes of a given raster dataset." You do have a raster to rotate, correct?
I assume you've found the Rotate tool and want to use the optional pivot point parameter. Doesn't it work to type in the xy values you want to use?
edit: I'm not sure what this means: "I have a feature class that contains all attributes of a given raster dataset." You do have a raster to rotate, correct?
I have the rotate tool but I am doing this in Modelbuilder. I would like to automatically create the pivot point from the x and y values for each of the 339 rasters that I have .
Then you'll have to use an iterator, collect the pivot point coordinates in a variable, and pass those using inline variable substitution. But, that's about as much help as I'll be with Modelbuilder.
Thank You Darren. I believe I have it working now.
How did you collect the pivot point coordinates in a variable and define the inline variabel?
Frank
I figured out how to do this. But the output pivot point was not in real coordinates. My input raster is in UTM33 (WGS84).
To get real coordinates for the pivot point use:
def fn(Input):
import arcpy
myRaster = arcpy.Raster(Input)
ext = myRaster.extent
midx = ext.XMin + ((ext.XMax - ext.XMin) / 2)
midy = ext.YMin + ((ext.YMax - ext.YMin) / 2)
return "{0} {1}".format(midx,midy)