<?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: Error 000368 in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/error-000368/m-p/1213649#M65605</link>
    <description>&lt;P&gt;perhaps&amp;nbsp;'points_layers' should be points_layer&amp;nbsp; lose the ' and the s&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 17 Sep 2022 18:27:08 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2022-09-17T18:27:08Z</dc:date>
    <item>
      <title>Error 000368</title>
      <link>https://community.esri.com/t5/python-questions/error-000368/m-p/1213641#M65603</link>
      <description>&lt;P&gt;C:\Python27\ArcGIS10.5\python.exe "F:/GIS/Python/GIS Data/SearchCursor.py"&lt;BR /&gt;0&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "F:/GIS/Python/GIS Data/SearchCursor.py", line 17, in &amp;lt;module&amp;gt;&lt;BR /&gt;arcpy.management.SelectLayerByLocation('points_layers', 'WITHIN', 'countries_layer')&lt;BR /&gt;File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\management.py", line 7860, in SelectLayerByLocation&lt;BR /&gt;raise e&lt;BR /&gt;arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.&lt;BR /&gt;ERROR 000368: Invalid input data.&lt;BR /&gt;Failed to execute (SelectLayerByLocation).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Code&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;arcpy&lt;BR /&gt;&lt;BR /&gt;arcpy.env.overwriteOutput = &lt;SPAN&gt;True&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;points = &lt;SPAN&gt;r'F:\GIS\Python\GIS Data\World_Cities\World_Cities.shp'&lt;BR /&gt;&lt;/SPAN&gt;countries = &lt;SPAN&gt;r'F:\GIS\Python\GIS Data\Countries\Country__5m_.shp'&lt;BR /&gt;&lt;/SPAN&gt;outpath = &lt;SPAN&gt;r'F:\GIS\Python\Output'&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;arcpy.env.workspace = &lt;SPAN&gt;'F:\GIS\Python\Output New'&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;with &lt;/SPAN&gt;arcpy.da.SearchCursor(countries&lt;SPAN&gt;, &lt;/SPAN&gt;[&lt;SPAN&gt;'FID'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'Ctry'&lt;/SPAN&gt;]) &lt;SPAN&gt;as &lt;/SPAN&gt;country_cursor:&lt;BR /&gt;    &lt;SPAN&gt;for &lt;/SPAN&gt;x &lt;SPAN&gt;in &lt;/SPAN&gt;country_cursor:&lt;BR /&gt;        &lt;SPAN&gt;print &lt;/SPAN&gt;x[&lt;SPAN&gt;0&lt;/SPAN&gt;]&lt;BR /&gt;        arcpy.MakeFeatureLayer_management(points&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'points_layer'&lt;/SPAN&gt;)&lt;BR /&gt;        arcpy.MakeFeatureLayer_management(countries&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'countries_layer'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;""" "FID" = {} """&lt;/SPAN&gt;.format(x[&lt;SPAN&gt;0&lt;/SPAN&gt;]))&lt;BR /&gt;        arcpy.management.SelectLayerByLocation(&lt;SPAN&gt;'points_layers'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'WITHIN'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'countries_layer'&lt;/SPAN&gt;)&lt;BR /&gt;        arcpy.FeatureClassToFeatureClass_conversion(&lt;SPAN&gt;'points_layer'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;outpath&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'cities_in_{}'&lt;/SPAN&gt;.format(x[&lt;SPAN&gt;1&lt;/SPAN&gt;]))&lt;/PRE&gt;</description>
      <pubDate>Sat, 17 Sep 2022 11:29:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-000368/m-p/1213641#M65603</guid>
      <dc:creator>AbhijitBiswas</dc:creator>
      <dc:date>2022-09-17T11:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error 000368</title>
      <link>https://community.esri.com/t5/python-questions/error-000368/m-p/1213649#M65605</link>
      <description>&lt;P&gt;perhaps&amp;nbsp;'points_layers' should be points_layer&amp;nbsp; lose the ' and the s&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Sep 2022 18:27:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-000368/m-p/1213649#M65605</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-09-17T18:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Error 000368</title>
      <link>https://community.esri.com/t5/python-questions/error-000368/m-p/1219390#M65752</link>
      <description>&lt;P&gt;I've never used the WITHIN value before.&amp;nbsp; I think what you probably want is INTERSECT.&amp;nbsp; That's a much more common way of finding points within the polygon boundaries of shapes like counties.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 15:27:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-000368/m-p/1219390#M65752</guid>
      <dc:creator>RogerDunnGIS</dc:creator>
      <dc:date>2022-10-06T15:27:25Z</dc:date>
    </item>
  </channel>
</rss>

