[MXD2map-commits] bsh.mxd-konverter: r216:d0acdab62b03

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jul 28 11:13:55 CEST 2011


details:   bsh.mxd-konverter/rev/d0acdab62b03

changeset: 216:d0acdab62b03

user:      Stephan Holl <stephan.holl at intevation.de>

date:      Mon Jul 25 10:51:39 2011 +0200

description:
imported patch arcpy-erweiterung


diffstat:

 contrib/python/generateHTML.py |  17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diffs (34 lines):

diff -r 0c58db91311c -r d0acdab62b03 contrib/python/generateHTML.py
--- 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>"


More information about the MXD2map-commits mailing list