<?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: arcpy.management.Project() doesn't honor feature layer's query in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1347385#M44773</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/30653"&gt;@MarlonAmaya&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Yes, this happens with the geoprocessing tool within ArcGIS Pro too. In the attached screenshot, I applied a definition query to the "source_rcl" layer (reducing it to 395 features) and then used it as input for the Project geoprocessing tool. The output, "map_rcl_out" had all 20, 727 features.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Nov 2023 20:30:01 GMT</pubDate>
    <dc:creator>Matt-Goodman</dc:creator>
    <dc:date>2023-11-08T20:30:01Z</dc:date>
    <item>
      <title>arcpy.management.Project() doesn't honor feature layer's query</title>
      <link>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1347211#M44768</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm running a stand alone script that, early on, uses &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/make-feature-layer.htm" target="_self"&gt;arcpy.management.MakeFeatureLayer()&lt;/A&gt; with a simple where clause defining the data I want included.&lt;/P&gt;&lt;P&gt;Later in the script, I use that feature layer as the input for &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/project.htm" target="_self"&gt;arcpy.management.Project()&lt;/A&gt;. Unfortunately, the output of the Project tool does not honor the SQL query applied to the feature layer.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Is this expected behavior? If not, any suggestions on how to troubleshoot why it's not being honored?&lt;/P&gt;&lt;P&gt;P.S. I asked ChatGPT this question and received a self-contradicting answer: it initially stated that this behavior is expected and that the Project() tool does not honor a feature layer's definition query, but then went on to suggest creating a feature layer with a where clause and feeding that as the input to the Project() tool.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;EDIT: I just inserted a line into my script to return a message giving the feature count of the feature layer immediately before the Project() tool uses it as input and the feature count returned&amp;nbsp;&lt;EM&gt;&lt;U&gt;is&lt;/U&gt;&amp;nbsp;&lt;/EM&gt;still limited by the where clause. So, I have to conclude that the Project() tool just ignores the query (I'm still not sure if this is by design or not).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 17:02:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1347211#M44768</guid>
      <dc:creator>Matt-Goodman</dc:creator>
      <dc:date>2023-11-08T17:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management.Project() doesn't honor feature layer's query</title>
      <link>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1347320#M44769</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/24871"&gt;@Matt-Goodman&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Per our documentation, the project tool will honor the definition query / selection set on the layer&lt;/P&gt;&lt;P&gt;-&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/project.htm#:~:text=Selection%20and%20definition%20queries%20on%20layers%20are%20supported%20by%20this%20tool.%20Only%20selected%20features%20in%20the%20layer%20will%20be%20projected%20when%20the%20selection%20or%20query%20is%20defined" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/project.htm#:~:text=Selection%20and%20definition%20queries%20on%20layers%20are%20supported%20by%20this%20tool.%20Only%20selected%20features%20in%20the%20layer%20will%20be%20projected%20when%20the%20selection%20or%20query%20is%20defined&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since the make feature layer is temp layer, I wonder if there is issue with the input you are providing. A quick test we can do is provide a selection/query to a feature class that is already created within your data source. Does this input combine with project provide the expected output?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Marlon&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 18:28:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1347320#M44769</guid>
      <dc:creator>MarlonAmaya</dc:creator>
      <dc:date>2023-11-08T18:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management.Project() doesn't honor feature layer's query</title>
      <link>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1347326#M44770</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/30653"&gt;@MarlonAmaya&lt;/a&gt;&amp;nbsp;, I did do some testing in my script, using the GetCount() function. I used GetCount() to compare the source feature class with the temporary MakeFeatureLayer version of it, and the query&amp;nbsp;&lt;U&gt;&lt;EM&gt;is&lt;/EM&gt;&lt;/U&gt;&amp;nbsp;correctly querying the data. I inserted the GetCount() function into my script in several different places, including immediately before the Project() tool runs, and the feature count indicates that the query&amp;nbsp;&lt;U&gt;&lt;EM&gt;is&lt;/EM&gt;&lt;/U&gt; indeed working correctly, but the Project() tool is not honoring it. The count returned by the GetCount function is lower than the count of the output of the Project() tool.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 18:56:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1347326#M44770</guid>
      <dc:creator>Matt-Goodman</dc:creator>
      <dc:date>2023-11-08T18:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management.Project() doesn't honor feature layer's query</title>
      <link>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1347345#M44771</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/24871"&gt;@Matt-Goodman&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The steps below are to see if the behavior is across the board.&lt;/P&gt;&lt;P&gt;Do you get the same result if you use the geoprocessing tool instead of arcpy?&lt;/P&gt;&lt;P&gt;what happens if you set a definition query on the feature class and use this as the input (instead of temp layer)?&lt;/P&gt;&lt;P&gt;Marlon&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 19:38:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1347345#M44771</guid>
      <dc:creator>MarlonAmaya</dc:creator>
      <dc:date>2023-11-08T19:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management.Project() doesn't honor feature layer's query</title>
      <link>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1347385#M44773</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/30653"&gt;@MarlonAmaya&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Yes, this happens with the geoprocessing tool within ArcGIS Pro too. In the attached screenshot, I applied a definition query to the "source_rcl" layer (reducing it to 395 features) and then used it as input for the Project geoprocessing tool. The output, "map_rcl_out" had all 20, 727 features.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 20:30:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1347385#M44773</guid>
      <dc:creator>Matt-Goodman</dc:creator>
      <dc:date>2023-11-08T20:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management.Project() doesn't honor feature layer's query</title>
      <link>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1347392#M44774</link>
      <description>&lt;P&gt;Also, I simplified my script to a very basic form, as a test. The attached shows the full text of the python as well as the message details after running it, demonstrating the feature counts before and after running the Project tool.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 20:36:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1347392#M44774</guid>
      <dc:creator>Matt-Goodman</dc:creator>
      <dc:date>2023-11-08T20:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management.Project() doesn't honor feature layer's query</title>
      <link>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1347407#M44775</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/24871"&gt;@Matt-Goodman&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I am seeing the same behavior with a simple feature class with 4 records, add def query to show 2, run project, output is 4.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please contact technical support to further investigate.&lt;/P&gt;&lt;P&gt;Marlon&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 20:50:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1347407#M44775</guid>
      <dc:creator>MarlonAmaya</dc:creator>
      <dc:date>2023-11-08T20:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management.Project() doesn't honor feature layer's query</title>
      <link>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1369378#M44891</link>
      <description>&lt;P&gt;I have the same issue with running project on a selection set in a stand-alone Python script. All features are in included in the output, not just the selection.&amp;nbsp; I have to export the selection to a new feature class before running the project.&amp;nbsp; Currently running ArcGIS Pro 3.1.3 installation package.&amp;nbsp; Tested at 3.1.1 and same issue there.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2024 03:24:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1369378#M44891</guid>
      <dc:creator>RobThomas</dc:creator>
      <dc:date>2024-01-12T03:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management.Project() doesn't honor feature layer's query</title>
      <link>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1369569#M44892</link>
      <description>&lt;P&gt;I'm replying to my own post, since Esri provided an answer to me through a bug report. Essentially this is expected behavior in earlier versions of ArcGIS Pro and I was mis-referencing documentation from a more recent version of Pro.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The management.Project() tool &lt;U&gt;&lt;EM&gt;does&amp;nbsp;not&lt;/EM&gt;&lt;/U&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;honor queried/selected features in versions of ArcGIS Pro up through 3.1.&amp;nbsp;Here is a snippet of the documentation from earlier versions (up through 3.1):&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;EM&gt;Selection and definition queries on layers &lt;STRONG&gt;are ignored&lt;/STRONG&gt; by this tool—all features in the dataset referenced by the layer will be projected. To project only selected features, consider using the Copy Features tool to create a temporary dataset, which will only contain the selected features, and use this intermediate dataset as input to the Project tool.&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;However, at version 3.2, the documentation correctly states:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;EM&gt;Selection and definition queries on layers &lt;STRONG&gt;are&lt;/STRONG&gt; supported by this tool. Only selected features in the layer will be projected when the selection or query is defined.&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I hope this clarifies the issue for anyone else noticing it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2024 14:51:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1369569#M44892</guid>
      <dc:creator>Matt-Goodman</dc:creator>
      <dc:date>2024-01-12T14:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.management.Project() doesn't honor feature layer's query</title>
      <link>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1369572#M44893</link>
      <description>&lt;P&gt;&lt;U&gt;&lt;EM&gt;The&lt;/EM&gt;&lt;/U&gt; Rob Thomas?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2024 14:52:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/arcpy-management-project-doesn-t-honor-feature/m-p/1369572#M44893</guid>
      <dc:creator>Matt-Goodman</dc:creator>
      <dc:date>2024-01-12T14:52:29Z</dc:date>
    </item>
  </channel>
</rss>

