I'm trying to work with ArcGIS Desktop with this problem. I need to export a data to geotiff with specific boundaries which are polygons, so i decided to use Data Driven Pages (DDP). Because there is hundreds of them I found a script (batch export to GeoTIFF in dataview) which should make this what i want much quicker:
mxd = arcpy.mapping.MapDocument("CURRENT")
res = arcpy.GetParameterAsText(0)
export = arcpy.GetParameterAsText(1)
preFix = arcpy.GetParameterAsText(2)
df = arcpy.mapping.ListDataFrames(mxd)[0]
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = pageNum
arcpy.AddMessage("Exporting Map " + str(pageNum) + " of " + str(mxd.dataDrivenPages.pageCount))
pageName = mxd.dataDrivenPages.pageRow.godlo
arcpy.mapping.ExportToTIFF(mxd, r"C:\xxx\ark_" + preFix + pageName + ".tif",df,
df_export_width=10369,
df_export_height=6375,
resolution = res,
world_file=True,
geoTIFF_tags=True)
del mxd
But at the end there is a problem with viewing them in arcMap, because some of rasters cover each other. When code is executing the scale in map window is jumping between two values, so I got like on the picture small rasters inside bigger ones.
Maybe someone has the same problem, with getting raster (geotiff) for each polygon?