<?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: How to find the extent of layer that was created with MakeFeatureLayer in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-find-the-extent-of-layer-that-was-created/m-p/1053576#M60978</link>
    <description>&lt;P&gt;The problem is to get the Layer.&lt;/P&gt;&lt;P&gt;After more testing, this looks like it works&lt;/P&gt;&lt;P&gt;arcpy.MakeFeatureLayer_management(r"C:\temp\data.gdb\City","bb","objectid &amp;lt; 10")&lt;BR /&gt;lyr = arcpy.mapping.Layer("bb")&lt;/P&gt;&lt;P&gt;lyr.getExtent()&lt;/P&gt;</description>
    <pubDate>Sun, 02 May 2021 05:01:24 GMT</pubDate>
    <dc:creator>mody_buchbinder</dc:creator>
    <dc:date>2021-05-02T05:01:24Z</dc:date>
    <item>
      <title>How to find the extent of layer that was created with MakeFeatureLayer</title>
      <link>https://community.esri.com/t5/python-questions/how-to-find-the-extent-of-layer-that-was-created/m-p/1052589#M60936</link>
      <description>&lt;P&gt;I work in arcpy for ArcMap and do MakeFeatureLayer with some expression.&lt;/P&gt;&lt;P&gt;Then I need to find the extent of this layer.&lt;/P&gt;&lt;P&gt;Describe on the layer name gives the original extent (without&amp;nbsp; the query)&lt;/P&gt;&lt;P&gt;I know I can do a search cursor and union the extent of all features but I would like to avoid it.&lt;/P&gt;&lt;P&gt;I can also do a CopyFeatures but this will create extra layer.&lt;/P&gt;&lt;P&gt;Any other ideas?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 05:05:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-find-the-extent-of-layer-that-was-created/m-p/1052589#M60936</guid>
      <dc:creator>mody_buchbinder</dc:creator>
      <dc:date>2021-04-29T05:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the extent of layer that was created with MakeFeatureLayer</title>
      <link>https://community.esri.com/t5/python-questions/how-to-find-the-extent-of-layer-that-was-created/m-p/1052605#M60938</link>
      <description>&lt;P&gt;For ArcMap, arcpy.mapping.Layer has a method called GetSelectedExtent.&lt;/P&gt;&lt;P&gt;&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/layer-class.htm#M2_GUID-A1071A05-599A-4662-8354-4F676BA87878" target="_blank" rel="noopener"&gt;ArcPy - Mapping module - Classes - Layer&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Pro users, unfortunately it does not have this method, but there is a solution here (yes, uses search cursor but does not union so should be fairly quick):&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-questions/arcpy-mp-get-selected-features-extent/td-p/160389" target="_blank" rel="noopener"&gt;ArcPy.mp Get Selected Features Extent&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 06:46:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-find-the-extent-of-layer-that-was-created/m-p/1052605#M60938</guid>
      <dc:creator>Tim_McGinnes</dc:creator>
      <dc:date>2021-04-29T06:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the extent of layer that was created with MakeFeatureLayer</title>
      <link>https://community.esri.com/t5/python-questions/how-to-find-the-extent-of-layer-that-was-created/m-p/1053576#M60978</link>
      <description>&lt;P&gt;The problem is to get the Layer.&lt;/P&gt;&lt;P&gt;After more testing, this looks like it works&lt;/P&gt;&lt;P&gt;arcpy.MakeFeatureLayer_management(r"C:\temp\data.gdb\City","bb","objectid &amp;lt; 10")&lt;BR /&gt;lyr = arcpy.mapping.Layer("bb")&lt;/P&gt;&lt;P&gt;lyr.getExtent()&lt;/P&gt;</description>
      <pubDate>Sun, 02 May 2021 05:01:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-find-the-extent-of-layer-that-was-created/m-p/1053576#M60978</guid>
      <dc:creator>mody_buchbinder</dc:creator>
      <dc:date>2021-05-02T05:01:24Z</dc:date>
    </item>
  </channel>
</rss>

