<?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 arcpy.MakeFeatureLayer_management performance issue in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcpy-makefeaturelayer-management-performance/m-p/134773#M619</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two layers in different SDE connections, one is Project layer and another one is Rail crossing layer which is very huge(more than 200k records). I have to find out the railcrossing feature for each project under one mile buffer radius of each project to accomplish this I created a loop and iterate through each project feature, create a buffer and then query the railcrossing feature layer using SelectLayerByLocation_management() then I got the result but the problem is in order to use&amp;nbsp;&lt;SPAN&gt;SelectLayerByLocation_management() I have to use&amp;nbsp;&lt;/SPAN&gt;MakeFeatureLayer_management() for both railcrossing and projectlocations because &lt;SPAN&gt;SelectLayerByLocation_management()&amp;nbsp; can only&amp;nbsp; perform&amp;nbsp;on layers and I can't use the featureclass paths of them so I have to perform&amp;nbsp;MakeFeatureLayer_management() every time iterating the loop which is hitting performance( taking 10 seconds for railroad crossing layer). Can any one suggest other alternate solution for this to minimize the performance&amp;nbsp;issue. Here is the sample code&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.Buffer_analysis(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"tempQueryLayer"&lt;/SPAN&gt;,  &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"bufferOutPut"&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"1 Miles"&lt;/SPAN&gt;)
arcpy.MakeFeatureLayer_management(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"bufferOutPut"&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"bufferLayer"&lt;/SPAN&gt;)
arcpy.MakeFeatureLayer_management(RAILCROSSING, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"railCrossingTempLayer"&lt;/SPAN&gt;)
arcpy.SelectLayerByLocation_management( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"railCrossingTempLayer"&lt;/SPAN&gt;,&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"COMPLETELY_WITHIN"&lt;/SPAN&gt;,&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"bufferLayer" &lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 07:32:18 GMT</pubDate>
    <dc:creator>pramodmandali</dc:creator>
    <dc:date>2021-12-11T07:32:18Z</dc:date>
    <item>
      <title>arcpy.MakeFeatureLayer_management performance issue</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcpy-makefeaturelayer-management-performance/m-p/134773#M619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two layers in different SDE connections, one is Project layer and another one is Rail crossing layer which is very huge(more than 200k records). I have to find out the railcrossing feature for each project under one mile buffer radius of each project to accomplish this I created a loop and iterate through each project feature, create a buffer and then query the railcrossing feature layer using SelectLayerByLocation_management() then I got the result but the problem is in order to use&amp;nbsp;&lt;SPAN&gt;SelectLayerByLocation_management() I have to use&amp;nbsp;&lt;/SPAN&gt;MakeFeatureLayer_management() for both railcrossing and projectlocations because &lt;SPAN&gt;SelectLayerByLocation_management()&amp;nbsp; can only&amp;nbsp; perform&amp;nbsp;on layers and I can't use the featureclass paths of them so I have to perform&amp;nbsp;MakeFeatureLayer_management() every time iterating the loop which is hitting performance( taking 10 seconds for railroad crossing layer). Can any one suggest other alternate solution for this to minimize the performance&amp;nbsp;issue. Here is the sample code&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.Buffer_analysis(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"tempQueryLayer"&lt;/SPAN&gt;,  &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"bufferOutPut"&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"1 Miles"&lt;/SPAN&gt;)
arcpy.MakeFeatureLayer_management(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"bufferOutPut"&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"bufferLayer"&lt;/SPAN&gt;)
arcpy.MakeFeatureLayer_management(RAILCROSSING, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"railCrossingTempLayer"&lt;/SPAN&gt;)
arcpy.SelectLayerByLocation_management( &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"railCrossingTempLayer"&lt;/SPAN&gt;,&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"COMPLETELY_WITHIN"&lt;/SPAN&gt;,&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"bufferLayer" &lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:32:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcpy-makefeaturelayer-management-performance/m-p/134773#M619</guid>
      <dc:creator>pramodmandali</dc:creator>
      <dc:date>2021-12-11T07:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.MakeFeatureLayer_management performance issue</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcpy-makefeaturelayer-management-performance/m-p/134774#M620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;There shouldn't be a need to create the buffers as the sb location tool has a 'within x distance' option. I also think only the data being selected has to be turned into a layer.&lt;/P&gt;&lt;P&gt;A spatial join may be faster, then clean up the data after (or use a one to many join with delimiters) or you could use the describe() object for your features to look for coincident geometries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2020 15:51:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcpy-makefeaturelayer-management-performance/m-p/134774#M620</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2020-01-24T15:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.MakeFeatureLayer_management performance issue</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcpy-makefeaturelayer-management-performance/m-p/134775#M621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for you're reply. I am using "Completely Within" .&amp;nbsp; sb_location tool will not take that parameter if it is "completely within" .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2020 16:30:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcpy-makefeaturelayer-management-performance/m-p/134775#M621</guid>
      <dc:creator>pramodmandali</dc:creator>
      <dc:date>2020-01-24T16:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.MakeFeatureLayer_management performance issue</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcpy-makefeaturelayer-management-performance/m-p/134776#M622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pramod,&lt;/P&gt;&lt;P&gt;I see, I'm unsure but that may be a more intensive operation, maybe use within with a large xy tolerance to first subset the selection, the run completely within on that subset? Good luck!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2020 16:45:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcpy-makefeaturelayer-management-performance/m-p/134776#M622</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2020-01-24T16:45:58Z</dc:date>
    </item>
  </channel>
</rss>

