1

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?

Example output

0

I don't know why you are getting small rasters, may be a topological issue with your data (e.g. it is multi-part)? But the scale jumping around as the code execute sounds correct as you are zooming to the extent of each polygon which will have a unique extent, may be you have accepted the default best fit option in the DDP dialogue?

DDP

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.