|
POST
|
Its all in the help link I provided. The sample does not exercise all parameters but here they are. The help explains each one. Syntax ExportToTIFF (map_document, out_tiff, {data_frame}, {df_export_width}, {df_export_height}, {resolution}, {world_file}, {color_mode}, {tiff_compression}, {geoTIFF_tags}) Jeff
... View more
10-13-2011
06:53 AM
|
0
|
0
|
3541
|
|
POST
|
I don't understand. Now exporting from the UI, the original issue, is no longer the main issue? Did the problem resolve itself? I didn't realize that you had OLE objects in your MXD. OLE objects are only supported with the ArcMap application being open because the OLE information is embedded within the arcmap.exe. You can run your Python scripts from the Python window using "current" but they can't be run outside of ArcGIS (when OLE objects are involved). Jeff
... View more
10-12-2011
07:17 AM
|
0
|
0
|
2485
|
|
POST
|
When the {symbology_only} property on UpdateLayer is set to False, it pulls across ALL layer properties, not just symbology. Have you tried working with the LabelClass object. It allows you to set the expression directly. http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/LabelClass/00s30000002t000000/ Jeff
... View more
10-12-2011
05:56 AM
|
0
|
0
|
1630
|
|
POST
|
Can you tell me what the value of your description is? print lyr.description Jeff
... View more
10-11-2011
12:28 PM
|
0
|
0
|
645
|
|
POST
|
Try arcpy.mapping. Check out the help and samples at the following link: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/DataDrivenPages/00s300000030000000/ I made changes to Sample #1 so you can export just the data frame and I also changed it to ExportToTIFF. import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\Project\NameOfMXD.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "Dataframe Name")[0]
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = pageNum
print "Exporting page {0} of {1}".format(str(mxd.dataDrivenPages.currentPageID), str(mxd.dataDrivenPages.pageCount))
arcpy.mapping.ExportToTiff(mxd, r"C:\Project\OutPut\Page" + str(pageNum) + ".tif", df)
del mxd
... View more
10-11-2011
11:59 AM
|
0
|
0
|
3541
|
|
POST
|
Jiaorong, Two more questions: 1) What DPI are you exporting the pages out to? If you reduce the DPI, does it get better? 2) As a test, could you try turning off the dem90_shade1 layer and then try? The best way for us to assess what is going on would be to get a copy of your data. Would it be possible to get me a map package or zip file. Please respond directly to jbarrette@esri.com Thanks, Jeff
... View more
10-11-2011
11:42 AM
|
0
|
0
|
2485
|
|
POST
|
Are you looking for delete_management? http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000052000000 Jeff
... View more
10-10-2011
07:02 AM
|
0
|
0
|
888
|
|
POST
|
Jiaorong, Questions: 1) Are you running out of disk space when producing the output? The first error message suggests that you are. 2) Are you writing to a single PDF file or a PDF file for each map page? 3) When you say it worked up to page 28, does that mean PDF files are being generated? 4) I assume you are doing this from the user interface. Have you tried exporting to PDF via arcpy.mapping? If you are having memory issues, then running an arcpy.mapping script outside of ArcMap may help. If you are running out of disk space, then this won't help at all. The following script will export all your pages into a single PDF: mxd = arcpy.mapping.MapDocument(r"C:\temp\sample[1].mxd")
ddp = mxd.dataDrivenPages
ddp.exportToPDF(r"C:\temp\output.pdf") The following script will export each page to a separate PDF (index # gets appended to the end of each file name: mxd = arcpy.mapping.MapDocument(r"current")
ddp = mxd.dataDrivenPages
ddp.exportToPDF(r"C:\temp\out.pdf", multiple_files="PDF_MULTIPLE_FILES_PAGE_INDEX") Jeff
... View more
10-10-2011
06:56 AM
|
0
|
0
|
2485
|
|
POST
|
Is it possible that your layer description is a number? Could you try changing line 39 to something like: outFile.write("\t\t\t Description: " + str(lyr.description) + "\n") Jeff
... View more
10-08-2011
06:08 PM
|
0
|
0
|
645
|
|
POST
|
My mistake. I included the [0] accidentally. Let me try again: myLayerObj = arcpy.mapping.ListLayers(mxd, "filter")[0] This returns a layer object myLayerListObj = arcpy.mapping.ListLayers(mxd, "filter") This returns a Python list object. If you want to get to items in the list you need to either use and index number or a for loop. If your MXD is designed with all layers having unique names, then if you use the correct filter, you will only have one item in your list and you can use [0] to extract it. There is a new arcpy.mapping tutorial that covers this in much better detail. http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Getting_started_with_arcpy_mapping_tutorial/00s30000006w000000/ Jeff
... View more
10-08-2011
06:03 PM
|
0
|
0
|
429
|
|
POST
|
Here is a help topic sample. If you join the beta community you'll be able to try out so much more of the arcpy.mapping functionality that was added at 10.1. ListBookmarks example 2 Similar to example 1, the following script will loop through each bookmark in the Transportation data frame, set the data frame extent, and export the data frame to a JPEG file. import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\Project\Project.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "Transportation")[0]
for bkmk in arcpy.mapping.ListBookmarks(mxd, data_frame=df):
df.extent = bkmk.extent
outFile = r"C:\Project\Output\\" + bkmk.name + ".jpg"
arcpy.mapping.ExportToJPEG(mxd, outFile, df)
del mxd
... View more
10-08-2011
11:44 AM
|
0
|
0
|
2924
|
|
POST
|
Could you please provide a little more information? Are you doing this in the UI, are you using arcpy.mapping? Thanks, Jeff
... View more
10-08-2011
11:38 AM
|
0
|
0
|
2485
|
|
POST
|
I think I know the problem. The simple solution is to first try: desc = arcpy.Describe(lyr) and not desc = arcpy.Describe(lyr.dataSource) The longer explanation: I had someone in my office sent me a layer file created using 9.3 Desktop to a 9.3 SDE (as well as a 10.0 layer file pointing to a 10.0 SDE). When I added their layer file to my 10.0 map document it displayed just fine, that is because we are on the same network and I can connect to the same SDE server as they can (I'm thinking this is similar to your workplace environment). But when I run the following I get the same error message that you are seeing: >>> mxd = arcpy.mapping.MapDocument("current") >>> lyr = arcpy.mapping.ListLayers(mxd)[0] >>> print lyr.dataSource C:\Users\UserName\AppData\Roaming\ESRI\ArcCatalog\demo.sde\sde.DBO.layer >>> desc = arcpy.Describe(lyr.dataSource) Runtime error <type 'exceptions.IOError'>: "C:\Users\UserName\AppData\Roaming\ESRI\ArcCatalog\demo.sde\sde.DBO.layer" does not exist This is because the layer file is persisting the original connection information as a property. When I print lyr.dataSource I get the path to the connection file above. The .sde file does NOT exist on my local machine so we should expect it to fail because that is what it is looking for. When we remove the lyr.dataSource and use desc = arcpy.Describe(lyr) >>> print desc.spatialReference.name GCS_WGS_1984 It works because it is using the current connection info rather than the property stored on the layer file. If I create a new local connection and if I perform a lyr.replaceDataSource using my local SDE connection file info, both methods work without error. Jeff
... View more
10-08-2011
11:36 AM
|
0
|
0
|
686
|
|
POST
|
When using List functions in arcpy.mapping you will always need to use the index number at the end: myLayer = arcpy.mapping.ListLayers(mxd, "filter")[0] This will return a layer object myLayer = arcpy.mapping.ListLayers(mxd, "filter")[0] This will return a Python list object Also - there way most likely a typo in your filter. Try using wildcard. myLayer = arcpy.mapping.ListLayers(mxd, "Bay, Lakes*")[0] Jeff
... View more
10-07-2011
06:52 AM
|
0
|
0
|
2131
|
|
POST
|
Check out the following sample scripts: http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=A910AB18-1422-2418-3418-3885D388EF60 There are some reporting tools that do exactly what you want. Jeff
... View more
10-07-2011
06:44 AM
|
0
|
0
|
2219
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-05-2025 11:20 AM | |
| 3 | 06-05-2025 09:21 AM | |
| 1 | 05-14-2025 01:19 PM | |
| 2 | 04-24-2025 07:54 AM | |
| 1 | 03-15-2025 07:19 PM |
| Online Status |
Online
|
| Date Last Visited |
yesterday
|