<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Generate Mapbooks with Pythonscript on AGS in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/generate-mapbooks-with-pythonscript-on-ags/m-p/303177#M11675</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Christian,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you able to share your script here so that we can gain more insight to what methods your script is calling?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On top of that, when you say you are running your script on the server, do you mean you are serving it out as a GP service? If so, perhaps we need to look into your server logs to identify what is the bottleneck. You may need to log at FINE or INFO level to see the details of the duration each process is taking.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Raymond&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 May 2014 10:57:16 GMT</pubDate>
    <dc:creator>RaymondHuang</dc:creator>
    <dc:date>2014-05-20T10:57:16Z</dc:date>
    <item>
      <title>Generate Mapbooks with Pythonscript on AGS</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/generate-mapbooks-with-pythonscript-on-ags/m-p/303176#M11674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried to export Mapbooks to PNG with an PYthonscript. The script works fine on Desktop and on Server. But on Server it takes much more time for creating only one of the PNGs. In the sum of over 150 PNGs it makes over a half of a day for executin the script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On Desktop, the script takes around 7 seconds per PNG, on server it takes around 100 seconds.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried it with two different servers, with different datasources (GDB and SDE) and I also tried it with Labeling on/off. It all makes no significant difference.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could anyone give me a hint how I could get it work faster? Or could anyone could explain why it is so?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 10:12:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/generate-mapbooks-with-pythonscript-on-ags/m-p/303176#M11674</guid>
      <dc:creator>ChristianMüller</dc:creator>
      <dc:date>2014-05-20T10:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Mapbooks with Pythonscript on AGS</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/generate-mapbooks-with-pythonscript-on-ags/m-p/303177#M11675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Christian,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you able to share your script here so that we can gain more insight to what methods your script is calling?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On top of that, when you say you are running your script on the server, do you mean you are serving it out as a GP service? If so, perhaps we need to look into your server logs to identify what is the bottleneck. You may need to log at FINE or INFO level to see the details of the duration each process is taking.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Raymond&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 10:57:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/generate-mapbooks-with-pythonscript-on-ags/m-p/303177#M11675</guid>
      <dc:creator>RaymondHuang</dc:creator>
      <dc:date>2014-05-20T10:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Mapbooks with Pythonscript on AGS</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/generate-mapbooks-with-pythonscript-on-ags/m-p/303178#M11676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Raymond,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;of course I could post the code of the Python script:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
#!/arcgisserver/arcgis/server/tools/python
#
# arcpy.GetParameterAsText(0): Kompletter Pfad der MXD
# arcpy.GetParameterAsText(1): Ausgabepfad fuer die Bilder
# arcpy.GetParameterAsText(2): Praefix fuer die Ausgabedatei, Nummerierung kommt aus Kartenserien-Konfiguration, Dateiendung wird angehaengt
# arcpy.GetParameterAsText(3): Debug-Flag

import arcpy

mxd = arcpy.mapping.MapDocument(arcpy.GetParameterAsText(0))
print arcpy.GetParameterAsText(0)
debugOn = arcpy.GetParameterAsText(3)
outPath = arcpy.GetParameterAsText(1)
outPrefix = arcpy.GetParameterAsText(2)

def getOutputName(prefix):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = prefix + str(ddp.pageRow.getValue(ddp.pageNameField.name)) + ".png"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return result

print "Start exporting %s PNGs" % (mxd.dataDrivenPages.pageCount)
maxRange = mxd.dataDrivenPages.pageCount + 1
if (debugOn == "1"):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for lyr in arcpy.mapping.ListLayers(mxd):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #get the source from the layer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if lyr.supports("workspacePath"):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; source = lyr.workspacePath
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "%s -&amp;gt; %s" % (lyr, source)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxRange = 15
for pageNum in range(1, maxRange):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (debugOn == "1"):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Page %s" % (pageNum)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.dataDrivenPages.currentPageID = pageNum
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ddp = mxd.dataDrivenPages
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (debugOn == "1"):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Exporting page {0} of {1}".format(str(mxd.dataDrivenPages.currentPageID), str(maxRange))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outputName = getOutputName(outPrefix)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print str(outPath) + "/" + str(outputName)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPNG(mxd, str(outPath) + "/" + str(outputName), resolution=150)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The first parameter gets the absolute path of the mxd, the second is for the outputpath of the PNGs, the third is a prefix for the PNGs name, to put all PNGs of the three MXDs together in one path. The fourth parameter is just for debugging/testing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The script is not served as as GP. As I start working on this topic, I got trouble with writing the files, and so we just used the script itself. In fact we (will) call the python script in an shell script. This shell script also produces PDF reports with the PNGs.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:32:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/generate-mapbooks-with-pythonscript-on-ags/m-p/303178#M11676</guid>
      <dc:creator>ChristianMüller</dc:creator>
      <dc:date>2021-12-11T14:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Mapbooks with Pythonscript on AGS</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/generate-mapbooks-with-pythonscript-on-ags/m-p/303179#M11677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Where is the data that is being displayed in the MXD's (the data source)?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 May 2014 15:45:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/generate-mapbooks-with-pythonscript-on-ags/m-p/303179#M11677</guid>
      <dc:creator>GISDev1</dc:creator>
      <dc:date>2014-05-22T15:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Mapbooks with Pythonscript on AGS</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/generate-mapbooks-with-pythonscript-on-ags/m-p/303180#M11678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The datasources are on the same server as the MXD and the script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The tested GDB was in the same directory as the MXD.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 May 2014 05:38:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/generate-mapbooks-with-pythonscript-on-ags/m-p/303180#M11678</guid>
      <dc:creator>ChristianMüller</dc:creator>
      <dc:date>2014-05-23T05:38:32Z</dc:date>
    </item>
  </channel>
</rss>

