diff contrib/python/generateHTML.py @ 216:d0acdab62b03

imported patch arcpy-erweiterung
author Stephan Holl <stephan.holl@intevation.de>
date Mon, 25 Jul 2011 10:51:39 +0200
parents 0c58db91311c
children 13f1cf17f620
line wrap: on
line diff
--- a/contrib/python/generateHTML.py	Fri Jul 22 09:45:47 2011 +0200
+++ b/contrib/python/generateHTML.py	Mon Jul 25 10:51:39 2011 +0200
@@ -60,6 +60,22 @@
         i=i+1
     print "</ul>"
 
+def generateArcImage(mapfile):
+	basename = os.path.basename(mapfile)
+	mxdfile = mapfile.replace(".map",".mxd")
+	output = mapfile.replace(".map", "_arcpy.png")
+	if debug:
+		print "MXDfile: %s\nOutput: %s " % (mxdfile, output)
+
+	if not output:
+		import arcpy
+		mxd = arcpy.mapping.MapDocument(mxdfile)
+		df = arcpy.mapping.ListDataFrames(mxd)[0]
+		arcpy.mapping.ExportToPNG(mxd, output, df, df_export_width=800, 
+					  df_export_height=600, world_file=True)
+		del mxd
+
+
 def writeGroups(mapfile,groups):
     if len(groups) > 1:
         print "Anzahl der Gruppen: %s" % len(groups)
@@ -103,6 +119,7 @@
                             ext =  line[9:].replace('"','').replace(' ', ',')
                             extent.append(ext)
     
+    		    generateArcImage(f)
                     print "<ul>"
                     writeLayers(f, layers, extent)
                     print "</ul>"
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)