<?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: Scan Dataset and Exporting Maps in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/scan-dataset-and-exporting-maps/m-p/627156#M6789</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would look into using cursors to access the data you need for each record in your dataset and reading them to a list(if you only need one value per dataset) or a dictionary if you need more than one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would then probably iterate through the list/dictionary and create a defintion query to your layer in your map document using the value(s) as needed, zoom to the feature, zoom back out to a set scale(if you are working with points you will definitely want to zoom back out, polygons you might want to zoom out by a certain amount).&amp;nbsp; After you have the extent set how you want, export out to whichever format works for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some handy links:&lt;/P&gt;&lt;P&gt;Introduction to the Arcpy Mapping Modules.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fdesktop.arcgis.com%2Fen%2Fdesktop%2Flatest%2Fanalyze%2Farcpy-mapping%2Fintroduction-to-arcpy-mapping.htm"&gt;https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fdesktop.arcgis.com%2Fen%2Fdesktop%2Flatest%2Fanalyze%2Farcpy-mapping%2Fintroduction-to-arcpy-mapping.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Introduction to arcpy.da.SearchCursor:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;sqi=2&amp;amp;ved=0ahUKEwjokLjEusrSAhWGYyYKHc-kAcAQFggfMAE&amp;amp;url=http%3A%2F%2Fdesktop.arcgis.com%2Fen%2Farcmap%2F10.3%2Fanalyze%2Fpython%2Fdata-access-using-cursors.htm&amp;amp;usg=AFQjCNFKYTo2AUoCRKm8ji89WphWlYIFeQ&amp;amp;bvm=bv.149093890,d.eWE"&gt;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;sqi=2&amp;amp;ved=0ahUKEwjokLjEusrSAhWGYyYKHc-kAcAQFggfMAE&amp;amp;url=http%3A%2F%2Fdesktop.arcgis.com%2Fen%2Farcmap%2F10.3%2Fanalyze%2Fpython%2Fdata-access-using-cursors.htm&amp;amp;usg=AFQjCNFKYTo2AUoCRKm8ji89WphWlYIFeQ&amp;amp;bvm=bv.149093890,d.eWE&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thread where I posted some code for creating several maps from a single dataset with many records with many values.&amp;nbsp; Please note I used a slightly different method then, but gives you some ideas for flow and syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/thread/160192"&gt;https://community.esri.com/thread/160192&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard Fairhurst excellent blog post about using cursors and dictionaries for data manipulation.&amp;nbsp; Should help with using cursors and reading in all the data you will need.&amp;nbsp; I would highly recommend only using the cursors for creating the list/dictionaries of data, since doing alot of geoprocessing while in a cursor tends to bog things down.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/blogs/richard_fairhurst/2014/11/08/turbo-charging-data-manipulation-with-python-cursors-and-dictionaries"&gt;https://community.esri.com/blogs/richard_fairhurst/2014/11/08/turbo-charging-data-manipulation-with-python-cursors-and-dictionaries&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arcpy Tool for exporting to PDF:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/exporttopdf.htm"&gt;http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/exporttopdf.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, look into Data Driven Pages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/thread/160192"&gt;https://community.esri.com/thread/160192&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Mar 2017 22:20:23 GMT</pubDate>
    <dc:creator>IanMurray</dc:creator>
    <dc:date>2017-03-09T22:20:23Z</dc:date>
    <item>
      <title>Scan Dataset and Exporting Maps</title>
      <link>https://community.esri.com/t5/mapping-questions/scan-dataset-and-exporting-maps/m-p/627155#M6788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am looking for an automated way to scan through a dataset, panning to the location of each observation on the map, then take a picture of that observation, and then name the picture after one of the variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am thinking that python is going to be my best best for accomplishing this with a for loop but am unsure of functions would be able to accomplish this. I have some experience with python but not a lot of experience with ArcGIS and python. You can see an example below of the type of picture I want to take. I don't have to select each observation like in the picture but that would be nice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;IMG __jive_id="337480" alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/337480_NJ_22__B100170.png" style="width: 620px; height: 264px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 21:15:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/scan-dataset-and-exporting-maps/m-p/627155#M6788</guid>
      <dc:creator>MichelConn1</dc:creator>
      <dc:date>2017-03-09T21:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Dataset and Exporting Maps</title>
      <link>https://community.esri.com/t5/mapping-questions/scan-dataset-and-exporting-maps/m-p/627156#M6789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would look into using cursors to access the data you need for each record in your dataset and reading them to a list(if you only need one value per dataset) or a dictionary if you need more than one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would then probably iterate through the list/dictionary and create a defintion query to your layer in your map document using the value(s) as needed, zoom to the feature, zoom back out to a set scale(if you are working with points you will definitely want to zoom back out, polygons you might want to zoom out by a certain amount).&amp;nbsp; After you have the extent set how you want, export out to whichever format works for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some handy links:&lt;/P&gt;&lt;P&gt;Introduction to the Arcpy Mapping Modules.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fdesktop.arcgis.com%2Fen%2Fdesktop%2Flatest%2Fanalyze%2Farcpy-mapping%2Fintroduction-to-arcpy-mapping.htm"&gt;https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fdesktop.arcgis.com%2Fen%2Fdesktop%2Flatest%2Fanalyze%2Farcpy-mapping%2Fintroduction-to-arcpy-mapping.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Introduction to arcpy.da.SearchCursor:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;sqi=2&amp;amp;ved=0ahUKEwjokLjEusrSAhWGYyYKHc-kAcAQFggfMAE&amp;amp;url=http%3A%2F%2Fdesktop.arcgis.com%2Fen%2Farcmap%2F10.3%2Fanalyze%2Fpython%2Fdata-access-using-cursors.htm&amp;amp;usg=AFQjCNFKYTo2AUoCRKm8ji89WphWlYIFeQ&amp;amp;bvm=bv.149093890,d.eWE"&gt;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;sqi=2&amp;amp;ved=0ahUKEwjokLjEusrSAhWGYyYKHc-kAcAQFggfMAE&amp;amp;url=http%3A%2F%2Fdesktop.arcgis.com%2Fen%2Farcmap%2F10.3%2Fanalyze%2Fpython%2Fdata-access-using-cursors.htm&amp;amp;usg=AFQjCNFKYTo2AUoCRKm8ji89WphWlYIFeQ&amp;amp;bvm=bv.149093890,d.eWE&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thread where I posted some code for creating several maps from a single dataset with many records with many values.&amp;nbsp; Please note I used a slightly different method then, but gives you some ideas for flow and syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/thread/160192"&gt;https://community.esri.com/thread/160192&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard Fairhurst excellent blog post about using cursors and dictionaries for data manipulation.&amp;nbsp; Should help with using cursors and reading in all the data you will need.&amp;nbsp; I would highly recommend only using the cursors for creating the list/dictionaries of data, since doing alot of geoprocessing while in a cursor tends to bog things down.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/blogs/richard_fairhurst/2014/11/08/turbo-charging-data-manipulation-with-python-cursors-and-dictionaries"&gt;https://community.esri.com/blogs/richard_fairhurst/2014/11/08/turbo-charging-data-manipulation-with-python-cursors-and-dictionaries&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arcpy Tool for exporting to PDF:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/exporttopdf.htm"&gt;http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/exporttopdf.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, look into Data Driven Pages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/thread/160192"&gt;https://community.esri.com/thread/160192&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 22:20:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/scan-dataset-and-exporting-maps/m-p/627156#M6789</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2017-03-09T22:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Dataset and Exporting Maps</title>
      <link>https://community.esri.com/t5/mapping-questions/scan-dataset-and-exporting-maps/m-p/627157#M6790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response Ian. I'll start looking into this information and see if I can't figure something out.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 22:27:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/scan-dataset-and-exporting-maps/m-p/627157#M6790</guid>
      <dc:creator>MichelConn1</dc:creator>
      <dc:date>2017-03-09T22:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Dataset and Exporting Maps</title>
      <link>https://community.esri.com/t5/mapping-questions/scan-dataset-and-exporting-maps/m-p/627158#M6791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This should be relatively straight forward, I feel a little bad throwing so many links at you.&amp;nbsp; I know there was another thread on GeoNet for zooming and exporting at multiple scales that is a bit more relevant, but I don't have it bookmarked like some of the others.&amp;nbsp; I'll dig around and see if I can find it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: Not so hard to find apparently, though this one is for a script tool.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/thread/95438"&gt;https://community.esri.com/thread/95438&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 22:42:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/scan-dataset-and-exporting-maps/m-p/627158#M6791</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2017-03-09T22:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Dataset and Exporting Maps</title>
      <link>https://community.esri.com/t5/mapping-questions/scan-dataset-and-exporting-maps/m-p/627159#M6792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to cobble together some working code from the links you gave thanks.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd = arcpy.mapping.MapDocument('CURRENT')
df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0]
OutputLocation=r"\\mriglobal\kcshares\Projects\311190\STATISTICAL ANALYSIS\PLOTS"
Layer = "Export_Output"
cursor = arcpy.SearchCursor(Layer)

for row in cursor:
 FID_txt=str(row.getValue('FID'))
 arcpy.SelectLayerByAttribute_management(Layer, "NEW_SELECTION" , "FID = " + FID_txt) 
 df.zoomToSelectedFeatures() 
 if df.scale&amp;lt;2000 and df.scale&amp;gt;300: 
&amp;nbsp;&amp;nbsp;&amp;nbsp; df.scale=2000
 if df.scale&amp;lt;300:
&amp;nbsp;&amp;nbsp;&amp;nbsp; df.scale=1000
 arcpy.RefreshActiveView()
 arcpy.mapping.ExportToJPEG(mxd, OutputLocation + '/' + row.getValue('SRI') + ".jpg", df, 1920, 1080) 
 arcpy.SelectLayerByAttribute_management(Layer, "CLEAR_SELECTION")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:43:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/scan-dataset-and-exporting-maps/m-p/627159#M6792</guid>
      <dc:creator>MichelConn1</dc:creator>
      <dc:date>2021-12-12T16:43:04Z</dc:date>
    </item>
  </channel>
</rss>

