Select to view content in your preferred language

Iterative Zoom to and export to JPG

5578
13
Jump to solution
11-14-2011 07:40 AM
AnthonyTimpson2
Regular Contributor
Hello,


I have been trying to string together a simple script to read through a Grid.shp, Zoom to each feature, Export that image to a jpg with a world file with a filename based on the Grid index of the iterated row. 

i tried to make this with Modelbuilder but it lacks the functionality it seems


I am absolutely green when it comes to python and I would greatly appreciate a nudge in the right direction.

thanks
Tags (2)
0 Kudos
13 Replies
JakeSkinner
Esri Esteemed Contributor

Just add the parcels to the map, save the MXD and then run the code.  The parcels should then be included.

0 Kudos
nathanbush
Deactivated User

Right, I didn't save the mxd before I ran the code.

Thanks.

0 Kudos
AnthonyTimpson2
Regular Contributor
You Sir are a Steely Eyed Missile man. Thank you!!
Thiru_P
Regular Contributor
Thanks Jake, you are a gem. It worked perfectly.

I wanted to Export the JGW world file for JPEGs too so I modified it and it saved many days of manual work. Thumbs up

mapping.ExportToJPEG(mxd, r"C:\temp\Map_" + str(x) + ".jpg", df, df_export_width=2209, df_export_height=1663, world_file=True)
0 Kudos