Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Export Map (Data Frame) to JPEG

$
0
0
I have an Index Feature Class that I want to use to export my CURRENT Data Frame to JPEG. I want to loop through each row within the Index Feature Class and for each row select the feature and use it to set the Current Extent and Scale and export the Data Frame to JPEG using the name of the selected feature (i.e. 3318BD07) I've attached my code so far, but its not passing the current row as new selection. Any assistance to update my code to accomplish the following will be appreciated.

Code:

>>> import arcpy,os
>>> mxd = arcpy.mapping.MapDocument("CURRENT")
>>> df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0]
>>> index10k = arcpy.mapping.ListLayers(mxd, "Index10k_wgs84",df)[0]
>>> rows = arcpy.SearchCursor(index10k,"","","TAG","")
>>> for row in rows:
...    df.extent = index10k.getSelectedExtent(False)
...    df.scale = df.scale*1.1
...    arcpy.mapping.ExportToJPEG(mxd, os.path.join(r'S:\Projects\01_Rebieeck_West\jpeg',row.getValue("TAG)+".jpg"),df)

Regads
Attached Thumbnails
Click image for larger version

Name:	IndexLayer.JPG‎
Views:	N/A
Size:	38.7 KB
ID:	21668   Click image for larger version

Name:	IndexSelected.JPG‎
Views:	N/A
Size:	40.2 KB
ID:	21669   Click image for larger version

Name:	ExportedDataFrameJPEG.JPG‎
Views:	N/A
Size:	96.9 KB
ID:	21672  

Viewing all articles
Browse latest Browse all 2485

Trending Articles