Skip to main content
Tweeted twitter.com/StackGIS/status/1218594066503520262
edited tags; edited title
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

How do you write a Writing world file when exporting a TIFF withusing ArcPy Mapping?

added 10 characters in body
Source Link
RyanKDalton
  • 23.2k
  • 17
  • 112
  • 180

According to documentation, the options are: Syntax ExportToTIFF (map_document, out_tiff, {data_frame}, {df_export_width}, {df_export_height}, {resolution}, {world_file}, {color_mode}, {tiff_compression}, {geoTIFF_tags})

ExportToTIFF (map_document, out_tiff, {data_frame}, {df_export_width}, {df_export_height}, {resolution}, {world_file}, {color_mode}, {tiff_compression}, {geoTIFF_tags})

However, this works:

import arcpy.mapping
mxd = arcpy.mapping.MapDocument("CURRENT")
arcpy.mapping.ListDataFrames(mxd)
arcpy.mapping.ExportToTIFF(mxd,r"D:\out2.tif","PAGE_LAYOUT",640,480,96)

but this:

arcpy.mapping.ExportToTIFF(mxd,r"D:\out2.tif","PAGE_LAYOUT",640,480,96,True)

yields: Runtime error <type 'exceptions.TypeError'>: PageLayoutObject: Error in executing ExportToTIFF

Am I doing something wrong with that Boolean for world_file?

According to documentation, the options are: Syntax ExportToTIFF (map_document, out_tiff, {data_frame}, {df_export_width}, {df_export_height}, {resolution}, {world_file}, {color_mode}, {tiff_compression}, {geoTIFF_tags})

However, this works:

import arcpy.mapping
mxd = arcpy.mapping.MapDocument("CURRENT")
arcpy.mapping.ListDataFrames(mxd)
arcpy.mapping.ExportToTIFF(mxd,r"D:\out2.tif","PAGE_LAYOUT",640,480,96)

but this:

arcpy.mapping.ExportToTIFF(mxd,r"D:\out2.tif","PAGE_LAYOUT",640,480,96,True)

yields: Runtime error <type 'exceptions.TypeError'>: PageLayoutObject: Error in executing ExportToTIFF

Am I doing something wrong with that Boolean for world_file?

According to documentation, the options are: Syntax

ExportToTIFF (map_document, out_tiff, {data_frame}, {df_export_width}, {df_export_height}, {resolution}, {world_file}, {color_mode}, {tiff_compression}, {geoTIFF_tags})

However, this works:

import arcpy.mapping
mxd = arcpy.mapping.MapDocument("CURRENT")
arcpy.mapping.ListDataFrames(mxd)
arcpy.mapping.ExportToTIFF(mxd,r"D:\out2.tif","PAGE_LAYOUT",640,480,96)

but this:

arcpy.mapping.ExportToTIFF(mxd,r"D:\out2.tif","PAGE_LAYOUT",640,480,96,True)

yields: Runtime error <type 'exceptions.TypeError'>: PageLayoutObject: Error in executing ExportToTIFF

Am I doing something wrong with that Boolean for world_file?

syntax for code blocks
Source Link
scw
  • 16.4k
  • 6
  • 65
  • 101

According to documentation, the options are: Syntax ExportToTIFF (map_document, out_tiff, {data_frame}, {df_export_width}, {df_export_height}, {resolution}, {world_file}, {color_mode}, {tiff_compression}, {geoTIFF_tags})

However, this works:

import arcpy.mapping mxd = arcpy.mapping.MapDocument("CURRENT") arcpy.mapping.ListDataFrames(mxd) arcpy.mapping.ExportToTIFF(mxd,r"D:\out2.tif","PAGE_LAYOUT",640,480,96)

import arcpy.mapping
mxd = arcpy.mapping.MapDocument("CURRENT")
arcpy.mapping.ListDataFrames(mxd)
arcpy.mapping.ExportToTIFF(mxd,r"D:\out2.tif","PAGE_LAYOUT",640,480,96)

but this:

arcpy.mapping.ExportToTIFF(mxd,r"D:\out2.tif","PAGE_LAYOUT",640,480,96,True)

arcpy.mapping.ExportToTIFF(mxd,r"D:\out2.tif","PAGE_LAYOUT",640,480,96,True)

yields: Runtime error <type 'exceptions.TypeError'>: PageLayoutObject: Error in executing ExportToTIFFRuntime error <type 'exceptions.TypeError'>: PageLayoutObject: Error in executing ExportToTIFF

Am I doing something wrong with that Boolean for world_file?

According to documentation, the options are: Syntax ExportToTIFF (map_document, out_tiff, {data_frame}, {df_export_width}, {df_export_height}, {resolution}, {world_file}, {color_mode}, {tiff_compression}, {geoTIFF_tags})

However, this works:

import arcpy.mapping mxd = arcpy.mapping.MapDocument("CURRENT") arcpy.mapping.ListDataFrames(mxd) arcpy.mapping.ExportToTIFF(mxd,r"D:\out2.tif","PAGE_LAYOUT",640,480,96)

but this:

arcpy.mapping.ExportToTIFF(mxd,r"D:\out2.tif","PAGE_LAYOUT",640,480,96,True)

yields: Runtime error <type 'exceptions.TypeError'>: PageLayoutObject: Error in executing ExportToTIFF

Am I doing something wrong with that Boolean for world_file?

According to documentation, the options are: Syntax ExportToTIFF (map_document, out_tiff, {data_frame}, {df_export_width}, {df_export_height}, {resolution}, {world_file}, {color_mode}, {tiff_compression}, {geoTIFF_tags})

However, this works:

import arcpy.mapping
mxd = arcpy.mapping.MapDocument("CURRENT")
arcpy.mapping.ListDataFrames(mxd)
arcpy.mapping.ExportToTIFF(mxd,r"D:\out2.tif","PAGE_LAYOUT",640,480,96)

but this:

arcpy.mapping.ExportToTIFF(mxd,r"D:\out2.tif","PAGE_LAYOUT",640,480,96,True)

yields: Runtime error <type 'exceptions.TypeError'>: PageLayoutObject: Error in executing ExportToTIFF

Am I doing something wrong with that Boolean for world_file?

Source Link
DanDye
  • 81
  • 1
  • 2
Loading