<?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 Why does ArcPy mapView.defaultCamera.getExtent not provide the real extents? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/why-does-arcpy-mapview-defaultcamera-getextent-not/m-p/641073#M49950</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using arcgispro 2.2.4, and have a python script which needs the actual extents of the current map view.&amp;nbsp; I use this code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#get the map extents from the current map...
 aprx = arcpy.mp.ArcGISProject("current")
 aprxMap = aprx.listMaps("Map")[0]
 mapView = aprx.listMaps()[0]
 mapExtents=mapView.defaultCamera.getExtent()
 TL = mapExtents.upperLeft
 BR = mapExtents.lowerRight&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which suggests the map upper latitude limit is -13.978...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="432440" alt="" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/432440_MapViewExtentsIncorrect2-.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;however, if I roll my mouse to the top left of the map view, it is more like -13.933&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="432433" alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/432433_MapViewExtentsIncorrect1-.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The extents do change when I pan the map, but they are always a significant subset of the actual viewable area, which is really strange.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can some one please let me know how I can get the actual extents of the map view?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:43:42 GMT</pubDate>
    <dc:creator>PaulKennedy1</dc:creator>
    <dc:date>2021-12-12T16:43:42Z</dc:date>
    <item>
      <title>Why does ArcPy mapView.defaultCamera.getExtent not provide the real extents?</title>
      <link>https://community.esri.com/t5/python-questions/why-does-arcpy-mapview-defaultcamera-getextent-not/m-p/641073#M49950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using arcgispro 2.2.4, and have a python script which needs the actual extents of the current map view.&amp;nbsp; I use this code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#get the map extents from the current map...
 aprx = arcpy.mp.ArcGISProject("current")
 aprxMap = aprx.listMaps("Map")[0]
 mapView = aprx.listMaps()[0]
 mapExtents=mapView.defaultCamera.getExtent()
 TL = mapExtents.upperLeft
 BR = mapExtents.lowerRight&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which suggests the map upper latitude limit is -13.978...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="432440" alt="" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/432440_MapViewExtentsIncorrect2-.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;however, if I roll my mouse to the top left of the map view, it is more like -13.933&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="432433" alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/432433_MapViewExtentsIncorrect1-.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The extents do change when I pan the map, but they are always a significant subset of the actual viewable area, which is really strange.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can some one please let me know how I can get the actual extents of the map view?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:43:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/why-does-arcpy-mapview-defaultcamera-getextent-not/m-p/641073#M49950</guid>
      <dc:creator>PaulKennedy1</dc:creator>
      <dc:date>2021-12-12T16:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Why does ArcPy mapView.defaultCamera.getExtent not provide the real extents?</title>
      <link>https://community.esri.com/t5/python-questions/why-does-arcpy-mapview-defaultcamera-getextent-not/m-p/641074#M49951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you used this background?&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/arcpy/mapping/camera-class.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/mapping/camera-class.htm"&gt;Camera—ArcPy | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it is a derived property so when you were scrolling is it at full extent? and is there any coordinate system set for the map?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2019 04:53:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/why-does-arcpy-mapview-defaultcamera-getextent-not/m-p/641074#M49951</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-01-03T04:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why does ArcPy mapView.defaultCamera.getExtent not provide the real extents?</title>
      <link>https://community.esri.com/t5/python-questions/why-does-arcpy-mapview-defaultcamera-getextent-not/m-p/641075#M49952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;I do have a spatial reference set for the map. It is GCS WGS 1984&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Having debugged this further, the camera extents DO-NOT change when the map is panned/zoomed and the python script rerun. The numbers remain the same.&lt;/P&gt;&lt;P&gt;I guess I am doing something wrong, just not sure what!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2019 05:28:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/why-does-arcpy-mapview-defaultcamera-getextent-not/m-p/641075#M49952</guid>
      <dc:creator>PaulKennedy1</dc:creator>
      <dc:date>2019-01-03T05:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why does ArcPy mapView.defaultCamera.getExtent not provide the real extents?</title>
      <link>https://community.esri.com/t5/python-questions/why-does-arcpy-mapview-defaultcamera-getextent-not/m-p/641076#M49953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Evening Dan,&lt;/P&gt;&lt;P&gt;any more thoughts how I can use python to get hold of the extents of my map view?&amp;nbsp; I dont see any way forward right now, as the camera simply does not provide the correct extents to the map view&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="color: #000000; background-color: #ffffff; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;#get the map extents from the current map...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;aprx &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; arcpy.mp.ArcGISProject(&lt;/SPAN&gt;&lt;SPAN style="color: #a31515;"&gt;"current"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mapView &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; aprx.listMaps()[&lt;/SPAN&gt;&lt;SPAN style="color: #09885a;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mapExtents&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;mapView.defaultCamera.getExtent()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TL &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; mapExtents.upperLeft&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BR &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; mapExtents.lowerRight&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ptGeometry &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; arcpy.PointGeometry(TL, mapExtents.spatialReference)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TLprojectedGeometry &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; ptGeometry.projectAs(spatialReference)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ptGeometry &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; arcpy.PointGeometry(BR, mapExtents.spatialReference)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BRprojectedGeometry &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; ptGeometry.projectAs(spatialReference)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2019 12:03:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/why-does-arcpy-mapview-defaultcamera-getextent-not/m-p/641076#M49953</guid>
      <dc:creator>PaulKennedy1</dc:creator>
      <dc:date>2019-01-07T12:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Why does ArcPy mapView.defaultCamera.getExtent not provide the real extents?</title>
      <link>https://community.esri.com/t5/python-questions/why-does-arcpy-mapview-defaultcamera-getextent-not/m-p/641077#M49954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From what I can see, camera extents only work correctly with map frames within layouts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is with a project with one map, one layout and one map frame in the layout..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;p = arcpy.mp.ArcGISProject("current")&lt;/P&gt;&lt;P&gt;l = p.listLayouts()[0]&lt;/P&gt;&lt;P&gt;f = l.listElements()[0]&lt;/P&gt;&lt;P&gt;f.camera.getExtent().upperLeft&lt;/P&gt;&lt;P&gt;&amp;lt;Point (436809.68803366175, 433075.2979928817, #, #)&amp;gt;&lt;/P&gt;&lt;P&gt;.. navigate in the layout's map frame..&lt;BR /&gt;f.camera.getExtent().upperLeft&lt;BR /&gt;&amp;lt;Point (437874.1306022081, 432917.17427798914, #, #)&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2019 13:04:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/why-does-arcpy-mapview-defaultcamera-getextent-not/m-p/641077#M49954</guid>
      <dc:creator>PeteCrosier</dc:creator>
      <dc:date>2019-01-07T13:04:27Z</dc:date>
    </item>
  </channel>
</rss>

