<?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: Create multiple Mxd and export it to JPEG using ArcPy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/create-multiple-mxd-and-export-it-to-jpeg-using/m-p/219667#M16938</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. But i don't understand how to replace the rasters into mxd&amp;nbsp;and then export. If i get likely structure the code, it would be useful to solve the issue.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 02 Jul 2017 11:24:10 GMT</pubDate>
    <dc:creator>ShouvikJha</dc:creator>
    <dc:date>2017-07-02T11:24:10Z</dc:date>
    <item>
      <title>Create multiple Mxd and export it to JPEG using ArcPy</title>
      <link>https://community.esri.com/t5/python-questions/create-multiple-mxd-and-export-it-to-jpeg-using/m-p/219665#M16936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on daily rainfall data. I have multiple rasters map for different dates. I want to convert those map into JPEG format along with all layouts (Title, Legend, North arrow, scalebar&amp;nbsp;etc). Already i made a map by manually which i attached below with my sample datasets.&lt;/P&gt;&lt;P&gt;I have numbers of datasets for different dates, therefore, i want to&amp;nbsp;do it using Arcpy to create the different date wise map and export it to JPEG format. How to do it in ArcPy environment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one script but that is for converting multiple mxd&amp;nbsp;to JPEG, but to create automatically mxd&amp;nbsp;files along with all layouts based on multiple date wise rasters&amp;nbsp;and then export it to JPEG,&amp;nbsp;I am getting trouble to make it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached below my sample datasets which I am working. One output map also attached with the sample data sets, which I made by manually. But instead of manually i just take the whole part in ArcPy.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; os

 folderPath &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"D:\data\sample_data"&lt;/SPAN&gt;&amp;nbsp; 
 &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; filename &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listdir&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;folderPath&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp; 
 fullpath &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;folderPath&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; filename&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&amp;nbsp; 
 &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isfile&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fullpath&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; basename&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; extension &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;splitext&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fullpath&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; extension&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;lower&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;".mxd"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapDocument&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fullpath&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ExportToJPEG&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; basename &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'.jpg'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; resolution &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;300&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:43:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-multiple-mxd-and-export-it-to-jpeg-using/m-p/219665#M16936</guid>
      <dc:creator>ShouvikJha</dc:creator>
      <dc:date>2021-12-11T10:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple Mxd and export it to JPEG using ArcPy</title>
      <link>https://community.esri.com/t5/python-questions/create-multiple-mxd-and-export-it-to-jpeg-using/m-p/219666#M16937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure I understand but why not using&amp;nbsp;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/updatingandfixingdatasources.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/updatingandfixingdatasources.htm"&gt;Updating and fixing data sources with arcpy.mapping—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp; to change the MXD with new raster, save it to temporary mxd and export it to JPEG?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have Fun&lt;/P&gt;&lt;P&gt;Mody&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Jul 2017 05:21:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-multiple-mxd-and-export-it-to-jpeg-using/m-p/219666#M16937</guid>
      <dc:creator>ModyBuchbinder</dc:creator>
      <dc:date>2017-07-02T05:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple Mxd and export it to JPEG using ArcPy</title>
      <link>https://community.esri.com/t5/python-questions/create-multiple-mxd-and-export-it-to-jpeg-using/m-p/219667#M16938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. But i don't understand how to replace the rasters into mxd&amp;nbsp;and then export. If i get likely structure the code, it would be useful to solve the issue.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Jul 2017 11:24:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-multiple-mxd-and-export-it-to-jpeg-using/m-p/219667#M16938</guid>
      <dc:creator>ShouvikJha</dc:creator>
      <dc:date>2017-07-02T11:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple Mxd and export it to JPEG using ArcPy</title>
      <link>https://community.esri.com/t5/python-questions/create-multiple-mxd-and-export-it-to-jpeg-using/m-p/219668#M16939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;it would be possible like this way, If I create one mxd&amp;nbsp;file, with all layouts which&amp;nbsp;&lt;/SPAN&gt;I&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;require in maps, can I do loop function for other rasters, So another&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;raster&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;just will add the existing mxd file through loop function and will follow the existing symbology and export it to JPG &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Jul 2017 12:14:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-multiple-mxd-and-export-it-to-jpeg-using/m-p/219668#M16939</guid>
      <dc:creator>ShouvikJha</dc:creator>
      <dc:date>2017-07-02T12:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple Mxd and export it to JPEG using ArcPy</title>
      <link>https://community.esri.com/t5/python-questions/create-multiple-mxd-and-export-it-to-jpeg-using/m-p/219669#M16940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; mxd = arcpy.mapping.MapDocument(r"C:\Project\Project.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "County Maps")[0]
# get layer raster1
lyr = arcpy.mapping.ListLayers(mxd, "raster1", df)[0]
#replace to layer raster2
lyr.replaceDataSource(r"C:\Project\Data", "RASTER_WORKSPACE", "raster2")
mxd.save()
# export to JPEG&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:12:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-multiple-mxd-and-export-it-to-jpeg-using/m-p/219669#M16940</guid>
      <dc:creator>ModyBuchbinder</dc:creator>
      <dc:date>2021-12-12T16:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple Mxd and export it to JPEG using ArcPy</title>
      <link>https://community.esri.com/t5/python-questions/create-multiple-mxd-and-export-it-to-jpeg-using/m-p/219670#M16941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3417"&gt;Buchbinder&lt;/A&gt; &amp;nbsp; I don't understand the structure of script which you posted. If you could brief it will be most useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Already I have &amp;nbsp;made a Mxd&amp;nbsp;file, that mxd file hold almost all information regarding single day of rainfall raster map,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i just want to perform a loop function which will take one by one raster from a folder and follow the same symbology of existing mxd then export it to jpg format. And based on image date, the title of the map (where I mentioned the date), that will also be changed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached sample data which I am working on. If you open this file hope you will get more clarity about the work&lt;/P&gt;&lt;P&gt;Thank you &amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Jul 2017 17:47:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-multiple-mxd-and-export-it-to-jpeg-using/m-p/219670#M16941</guid>
      <dc:creator>ShouvikJha</dc:creator>
      <dc:date>2017-07-02T17:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple Mxd and export it to JPEG using ArcPy</title>
      <link>https://community.esri.com/t5/python-questions/create-multiple-mxd-and-export-it-to-jpeg-using/m-p/219671#M16942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;please guide us, how to do it ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jul 2017 09:03:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-multiple-mxd-and-export-it-to-jpeg-using/m-p/219671#M16942</guid>
      <dc:creator>ShouvikJha</dc:creator>
      <dc:date>2017-07-03T09:03:05Z</dc:date>
    </item>
  </channel>
</rss>

