<?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: Issue with select by location arcpy with ArcGIS Pro in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607029#M26943</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also... I always Delete_management anything that is in_memory/memory at the end of my scripts.&amp;nbsp; Don't want to tempt remnants lurking around&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Feb 2020 16:32:34 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2020-02-12T16:32:34Z</dc:date>
    <item>
      <title>Issue with select by location arcpy with ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607021#M26935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am running an arcpy script in&amp;nbsp;command prompt with ArcGIS Pro installed.&amp;nbsp;For some reason the Select By location tool produce different result every time I run it.&lt;/P&gt;&lt;P&gt;Here is the selection code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.SelectLayerByLocation_management('lowland_layer', 'INTERSECT', 'buildings_layer', selection_type='NEW_SELECTION')&lt;BR /&gt;arcpy.CopyFeatures_management('lowland_layer', 'lowlands_with_buildings.shp')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have no idea why this would produce different results everytime I run it. I have already made sure that all files has the same coordinate system, as well as the outputs.&lt;/P&gt;&lt;DIV style="color: #bbbbbb; background-color: #282c34; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2020 14:49:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607021#M26935</guid>
      <dc:creator>deleted-user-3K8mKpoPb261</dc:creator>
      <dc:date>2020-02-12T14:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with select by location arcpy with ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607022#M26936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the help topic&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/select-layer-by-location.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/select-layer-by-location.htm"&gt;Select Layer By Location—Data Management toolbox | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff; font-weight: 300;"&gt;Determines how the selection will be applied to the input and how to combine it with an existing selection. Note that there is no option here to clear an existing selection. To clear a selection, use the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="background-color: #ffffff; font-weight: 300; font-size: 14.875px;"&gt;CLEAR_SELECTION&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff; font-weight: 300;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;option on the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff; font-weight: 300;"&gt;Select Layer By Attribute&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff; font-weight: 300;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;tool.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2020 15:16:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607022#M26936</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-02-12T15:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with select by location arcpy with ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607023#M26937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm actually creating the layers right before the selection (with MakeFeatureLayer). So I'm assuming a preselected layer shouldn't be the issue&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2020 15:25:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607023#M26937</guid>
      <dc:creator>deleted-user-3K8mKpoPb261</dc:creator>
      <dc:date>2020-02-12T15:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with select by location arcpy with ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607024#M26938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It would be good to show additional code then.&amp;nbsp; Given that we can't see what workspaces are set or how you are creating and managing layers, it is difficult to give much more feedback than what Dan has already done.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2020 15:30:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607024#M26938</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-02-12T15:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with select by location arcpy with ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607025#M26939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It wouldn't hurt to see if clearing the selection to rule it out... you mentioned running tool multiple times, but you don't indicate whether map/pro is shut down between... things that you don't think persist within a session might surprise you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2020 15:33:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607025#M26939</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-02-12T15:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with select by location arcpy with ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607026#M26940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The script is very long and uses functions from other .py file. But long script short, here is the script config:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.env.overwriteOutput = True&lt;BR /&gt;arcpy.env.qualifiedFieldNames = False&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I run multiple functions imported from another python file but based on arcpy. Loops are done using the 'in_memory' workspace.&lt;/P&gt;&lt;P&gt;And I'm using .shp to save all files.&lt;/P&gt;&lt;P&gt;Everything is working fine except the part where I do this selection. I'm doing other selections as well and they all work fine. I really have no idea what going on. Should I delete/clear selection before running a selection? (I never had to that before though)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another thing is that I saved these selection files at the end of the script. And I do the selection manually, it works fine. It's only when I run it as a script that there's this issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2020 15:46:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607026#M26940</guid>
      <dc:creator>deleted-user-3K8mKpoPb261</dc:creator>
      <dc:date>2020-02-12T15:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with select by location arcpy with ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607027#M26941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;running it manually and it works fine does suggest that the selection isn't being cleared out in the script.&amp;nbsp; Only you can test this&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2020 15:48:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607027#M26941</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-02-12T15:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with select by location arcpy with ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607028#M26942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK. I'll try to make this fix and follow-up. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2020 15:51:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607028#M26942</guid>
      <dc:creator>deleted-user-3K8mKpoPb261</dc:creator>
      <dc:date>2020-02-12T15:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with select by location arcpy with ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607029#M26943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also... I always Delete_management anything that is in_memory/memory at the end of my scripts.&amp;nbsp; Don't want to tempt remnants lurking around&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2020 16:32:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607029#M26943</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-02-12T16:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with select by location arcpy with ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607030#M26944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So the 'clear_selection' did not fix the issue but I think I figure out the solution after multiple tests.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I'm using this workflow the selection is messed up:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;this_feature &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CopyFeatures_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'this_feature0.shp'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'this_feature1.shp'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;this_feature&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"some_field"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; features&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; afeature &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; features&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; condition_met&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            features&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;deleteRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;this_feature&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'this_feature_lyr'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# creating the layer right after UpdateCursor&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;this_selecting_feature&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'this_selecting_feature_lyr'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByLocation_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'this_feature_lyr'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'INTERSECT'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'this_selecting_feature_lyr'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; selection_type&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'NEW_SELECTION'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# this final output will change each time I run the script&lt;/SPAN&gt;
updated_features &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CopyFeatures_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'this_feature_lyr'&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'updated_features.shp'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if I make a copy after the UpdateCursor then everything seems fine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'this_feature0.shp'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"some_field"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; features&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; afeature &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; features&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; condition_met&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            features&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;deleteRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CopyFeatures_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'this_feature0.shp'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'this_feature1.shp'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# copy after UpdateCursor&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'this_feature1.shp'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'this_feature_lyr'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; 
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;this_selecting_feature&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'this_selecting_feature_lyr'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByLocation_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'this_feature_lyr'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'INTERSECT'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'this_selecting_feature_lyr'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; selection_type&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'NEW_SELECTION'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# this final output will be correct&lt;/SPAN&gt;
updated_features &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CopyFeatures_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'this_feature_lyr'&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'updated_features.shp'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't really know why to be honest. Maybe its an issue with memory management. But this has fixed the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:00:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607030#M26944</guid>
      <dc:creator>deleted-user-3K8mKpoPb261</dc:creator>
      <dc:date>2021-12-12T02:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with select by location arcpy with ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607031#M26945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your first code block, where is &lt;CODE&gt;this_selecting_feature &lt;/CODE&gt;being defined?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, where are you copying into memory?&amp;nbsp; Neither of the code blocks show any references to any in-memory workspace.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2020 22:39:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607031#M26945</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-02-12T22:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with select by location arcpy with ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607032#M26946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually this part of the code doesn't use any in_memory. `this_feature` was created, but `this_selecting_feature` is an existing file on the machine and its' the first time it's used in the code. Basically it's something like: this_selecting_feature = "path/to/file.shp"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I mentioned `in_memory` above to explain the content of my code. Just in case that might be the issue. But it seems like it's not that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My conclusion from this is that you can't use a variable/file modified with UpdateCursor as a layer for selection.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Feb 2020 02:55:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/issue-with-select-by-location-arcpy-with-arcgis/m-p/607032#M26946</guid>
      <dc:creator>deleted-user-3K8mKpoPb261</dc:creator>
      <dc:date>2020-02-13T02:55:32Z</dc:date>
    </item>
  </channel>
</rss>

