<?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: select by location using &amp;quot;layer URL&amp;quot; instead of layer name in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/select-by-location-using-quot-layer-url-quot/m-p/863185#M4270</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This morning I was able to use arcpy commands easily&amp;nbsp;by simply referring to a feature layer's url:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r'https&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;//&lt;/SPAN&gt;www&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;my&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;org&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;gisfed&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;rest&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;services&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;&lt;SPAN class="comment token"&gt;###/FeatureServer/9'&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; f &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFields&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;f&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name&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;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'*'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# both work as expected from a spyder console...       &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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 10:42:36 GMT</pubDate>
    <dc:creator>JoeBorgione</dc:creator>
    <dc:date>2021-12-12T10:42:36Z</dc:date>
    <item>
      <title>select by location using "layer URL" instead of layer name</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/select-by-location-using-quot-layer-url-quot/m-p/863181#M4266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hy guys, is there any way to use the select by&amp;nbsp;location tool (via python) but using layer URL not layer name&lt;BR /&gt;eg:&amp;nbsp;arcpy.SelectLayerByLocation_management(URL layer1"CROSSED_BY_THE_OUTLINE_OF",URL layer2,"","ADD_TO_SELECTION")&lt;BR /&gt;also I want to use searchCursor and updateCursor using Layer URL not layer name&lt;BR /&gt;I mean by URL, the REST URL of my layer service on arcgis online&lt;BR /&gt;I am using ArcGis Pro&lt;BR /&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Jun 2020 19:36:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/select-by-location-using-quot-layer-url-quot/m-p/863181#M4266</guid>
      <dc:creator>MedMZOURI</dc:creator>
      <dc:date>2020-06-06T19:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: select by location using "layer URL" instead of layer name</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/select-by-location-using-quot-layer-url-quot/m-p/863182#M4267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With arcpy in arcgis pro&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;P&gt;using the api for python&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html?highlight=select#arcgis.features.SpatialDataFrame.select_by_location" title="https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html?highlight=select#arcgis.features.SpatialDataFrame.select_by_location"&gt;arcgis.features module — arcgis 1.8.0 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;no mention of url's though&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Jun 2020 20:56:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/select-by-location-using-quot-layer-url-quot/m-p/863182#M4267</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-06-06T20:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: select by location using "layer URL" instead of layer name</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/select-by-location-using-quot-layer-url-quot/m-p/863183#M4268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Take a look at an earlier post of mine :&amp;nbsp;&lt;A href="https://community.esri.com/thread/246363"&gt;Using arcpy to copy a portal feature service to a fgdb feature class&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In it, &lt;A href="https://community.esri.com/migrated-users/3420"&gt;Joshua Bixby&lt;/A&gt;‌ provides me with a solution that I got to work to downloade a feature in a hosted feature layer to a local file gdb.&amp;nbsp; He may be able to provide a bit more insight to your specific quest.&amp;nbsp; I too have a need to use arcpy functions like arcpy.ListFields() on a hosted feature service; it would be nice to use cursors as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt;‌ : if it ain't one new thing it's another: arcade one day, python api the next...&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/silly.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Jun 2020 00:25:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/select-by-location-using-quot-layer-url-quot/m-p/863183#M4268</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-06-07T00:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: select by location using "layer URL" instead of layer name</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/select-by-location-using-quot-layer-url-quot/m-p/863184#M4269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This can all be done using ArcPy.&amp;nbsp; Just use &lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/make-feature-layer.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/make-feature-layer.htm"&gt;Make Feature Layer—Data Management toolbox | Documentation&lt;/A&gt; to make a layer first and then run your selection against it.&amp;nbsp; If you are running a standalone script outside of ArcGIS Pro, use &lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/functions/signintoportal.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/functions/signintoportal.htm"&gt;SignInToPortal—ArcPy Functions | Documentation&lt;/A&gt; to authenticate your Python session first.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Jun 2020 18:41:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/select-by-location-using-quot-layer-url-quot/m-p/863184#M4269</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-06-07T18:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: select by location using "layer URL" instead of layer name</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/select-by-location-using-quot-layer-url-quot/m-p/863185#M4270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This morning I was able to use arcpy commands easily&amp;nbsp;by simply referring to a feature layer's url:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r'https&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;//&lt;/SPAN&gt;www&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;my&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;org&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;gisfed&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;rest&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;services&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;&lt;SPAN class="comment token"&gt;###/FeatureServer/9'&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; f &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFields&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;f&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name&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;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'*'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# both work as expected from a spyder console...       &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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:42:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/select-by-location-using-quot-layer-url-quot/m-p/863185#M4270</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-12T10:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: select by location using "layer URL" instead of layer name</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/select-by-location-using-quot-layer-url-quot/m-p/1087629#M6463</link>
      <description>&lt;P&gt;Did you ever resolve this?&amp;nbsp; I'm having a similar issue, and the online layer is massive (167M+ records) so copying isn't practical. See&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/select-by-location-from-online-feature-layer-using/m-p/1087610#M6462" target="_blank"&gt;https://community.esri.com/t5/arcgis-api-for-python-questions/select-by-location-from-online-feature-layer-using/m-p/1087610#M6462&lt;/A&gt;&amp;nbsp;for details.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 19:10:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/select-by-location-using-quot-layer-url-quot/m-p/1087629#M6463</guid>
      <dc:creator>ChuckBenton</dc:creator>
      <dc:date>2021-08-10T19:10:13Z</dc:date>
    </item>
  </channel>
</rss>

