<?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: Panning to lat lon in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/panning-to-lat-lon/m-p/265315#M20413</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Scott,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use the ArcPy mapping module to zoom to extent or pan to a feature.&amp;nbsp; Here is an example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
df.zoomToSelectedFeatures()
arcpy.RefreshActiveView()
del mxd
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;This should zoom to selected features.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a link to more information on zooming to features: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/DataFrame/00s300000003000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/DataFrame/00s300000003000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Enjoy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 12:58:57 GMT</pubDate>
    <dc:creator>AndrewChapkowski</dc:creator>
    <dc:date>2021-12-11T12:58:57Z</dc:date>
    <item>
      <title>Panning to lat lon</title>
      <link>https://community.esri.com/t5/python-questions/panning-to-lat-lon/m-p/265313#M20411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a way to center the data/layout view on a set of lat-lon coordinates?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or is the only way to calculate an extent on the coordinates and then change the extent?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Jan 2011 20:09:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/panning-to-lat-lon/m-p/265313#M20411</guid>
      <dc:creator>ScottOatley</dc:creator>
      <dc:date>2011-01-08T20:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Panning to lat lon</title>
      <link>https://community.esri.com/t5/python-questions/panning-to-lat-lon/m-p/265314#M20412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;there should be a go to Xy tool in the basic toolbar.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you have trouble saving a specific location between data an layout views you can create bookmarks on the top toolbar to save specific coordinates and viewing scales.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Jan 2011 07:03:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/panning-to-lat-lon/m-p/265314#M20412</guid>
      <dc:creator>MIchalBularz</dc:creator>
      <dc:date>2011-01-09T07:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Panning to lat lon</title>
      <link>https://community.esri.com/t5/python-questions/panning-to-lat-lon/m-p/265315#M20413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Scott,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use the ArcPy mapping module to zoom to extent or pan to a feature.&amp;nbsp; Here is an example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
df.zoomToSelectedFeatures()
arcpy.RefreshActiveView()
del mxd
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;This should zoom to selected features.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a link to more information on zooming to features: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/DataFrame/00s300000003000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/DataFrame/00s300000003000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Enjoy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:58:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/panning-to-lat-lon/m-p/265315#M20413</guid>
      <dc:creator>AndrewChapkowski</dc:creator>
      <dc:date>2021-12-11T12:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Panning to lat lon</title>
      <link>https://community.esri.com/t5/python-questions/panning-to-lat-lon/m-p/265316#M20414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Scott,&lt;BR /&gt;&lt;BR /&gt;You can use the ArcPy mapping module to zoom to extent or pan to a feature.&amp;nbsp; &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, ultimately, if I want to do the equivalent of say:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
&lt;STRONG&gt;df.zoomToXY(lat, long)&lt;/STRONG&gt;
arcpy.RefreshActiveView()
del mxd&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is no equivalent of the bold statement in the code above. I have to convert my lat-long coordinates to an extent and use zoomToExtent().&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:58:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/panning-to-lat-lon/m-p/265316#M20414</guid>
      <dc:creator>ScottOatley</dc:creator>
      <dc:date>2021-12-11T12:58:59Z</dc:date>
    </item>
  </channel>
</rss>

