<?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 SelectLayerByLocation 'WITHIN_A_DISTANCE' from point vs 'INTERSECT' point buffer in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/selectlayerbylocation-within-a-distance-from-point/m-p/430516#M33833</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm having trouble understanding the 'WITHIN_A_DISTANCE' option for arcpy.SelectLayerByLocation_management.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I use arcpy.SelectLayerByLocation_management(lbTaCentroidsLayerName, 'WITHIN_A_DISTANCE', sitePntGeom, '25 Miles'), I get 815 points selected, but when I do arcpy.SelectLayerByLocation_management(lbTaCentroidsLayerName, 'INTERSECT', siteBufferFc) with a 25 miles buffer of the sitePntGeom, I get 1182 points selected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I missing something obvious?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;In [1]: import arcpy

In [3]: siteLon, siteLat = -122.276518, 47.191838

In [4]: sitePoint = arcpy.Point(siteLon, siteLat)

In [7]: sitePntGeom = arcpy.PointGeometry(sitePoint, wgs1984SpatialRef)

In [13]: lbTaCentroidsLayerName = 'centroidsFeatureLayer'

In [14]: arcpy.MakeFeatureLayer_management(centroidsFeatureClassName, lbTaCentroidsLayerName)
Out[14]: &amp;lt;Result 'centroidsFeatureLayer'&amp;gt;

In [15]: arcpy.SelectLayerByLocation_management(lbTaCentroidsLayerName, 'WITHIN_A_DISTANCE', sitePntGeom, '25 Miles')
Out[15]: &amp;lt;Result 'centroidsFeatureLayer'&amp;gt;

In [16]: int(arcpy.GetCount_management(lbTaCentroidsLayerName).getOutput(0))
Out[16]: 815

In [17]: siteBufferFc = 'in_memory/siteBuffer'

In [18]: arcpy.Buffer_analysis(sitePntGeom, siteBufferFc, '25 Miles')
Out[18]: &amp;lt;Result 'in_memory\\siteBuffer'&amp;gt;

In [19]: arcpy.SelectLayerByLocation_management(lbTaCentroidsLayerName, 'INTERSECT', siteBufferFc)
Out[19]: &amp;lt;Result 'centroidsFeatureLayer'&amp;gt;

In [20]: int(arcpy.GetCount_management(lbTaCentroidsLayerName).getOutput(0))
Out[20]: 1182

In [21]:&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Jun 2013 20:25:07 GMT</pubDate>
    <dc:creator>CharlesArnold</dc:creator>
    <dc:date>2013-06-20T20:25:07Z</dc:date>
    <item>
      <title>SelectLayerByLocation 'WITHIN_A_DISTANCE' from point vs 'INTERSECT' point buffer</title>
      <link>https://community.esri.com/t5/python-questions/selectlayerbylocation-within-a-distance-from-point/m-p/430516#M33833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm having trouble understanding the 'WITHIN_A_DISTANCE' option for arcpy.SelectLayerByLocation_management.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I use arcpy.SelectLayerByLocation_management(lbTaCentroidsLayerName, 'WITHIN_A_DISTANCE', sitePntGeom, '25 Miles'), I get 815 points selected, but when I do arcpy.SelectLayerByLocation_management(lbTaCentroidsLayerName, 'INTERSECT', siteBufferFc) with a 25 miles buffer of the sitePntGeom, I get 1182 points selected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I missing something obvious?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;In [1]: import arcpy

In [3]: siteLon, siteLat = -122.276518, 47.191838

In [4]: sitePoint = arcpy.Point(siteLon, siteLat)

In [7]: sitePntGeom = arcpy.PointGeometry(sitePoint, wgs1984SpatialRef)

In [13]: lbTaCentroidsLayerName = 'centroidsFeatureLayer'

In [14]: arcpy.MakeFeatureLayer_management(centroidsFeatureClassName, lbTaCentroidsLayerName)
Out[14]: &amp;lt;Result 'centroidsFeatureLayer'&amp;gt;

In [15]: arcpy.SelectLayerByLocation_management(lbTaCentroidsLayerName, 'WITHIN_A_DISTANCE', sitePntGeom, '25 Miles')
Out[15]: &amp;lt;Result 'centroidsFeatureLayer'&amp;gt;

In [16]: int(arcpy.GetCount_management(lbTaCentroidsLayerName).getOutput(0))
Out[16]: 815

In [17]: siteBufferFc = 'in_memory/siteBuffer'

In [18]: arcpy.Buffer_analysis(sitePntGeom, siteBufferFc, '25 Miles')
Out[18]: &amp;lt;Result 'in_memory\\siteBuffer'&amp;gt;

In [19]: arcpy.SelectLayerByLocation_management(lbTaCentroidsLayerName, 'INTERSECT', siteBufferFc)
Out[19]: &amp;lt;Result 'centroidsFeatureLayer'&amp;gt;

In [20]: int(arcpy.GetCount_management(lbTaCentroidsLayerName).getOutput(0))
Out[20]: 1182

In [21]:&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 20:25:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/selectlayerbylocation-within-a-distance-from-point/m-p/430516#M33833</guid>
      <dc:creator>CharlesArnold</dc:creator>
      <dc:date>2013-06-20T20:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: SelectLayerByLocation 'WITHIN_A_DISTANCE' from point vs 'INTERSECT' point buffer</title>
      <link>https://community.esri.com/t5/python-questions/selectlayerbylocation-within-a-distance-from-point/m-p/430517#M33834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I assume it's because 'sitePntGeom' is assigned a geographic coordinate system (wgs1984SpatialRef), making oblong buffers, while SelectLayerByLocation may be using a projected coordinate system, making a circular search area. Is the feature class (centroidsFeatureClassName) projected? In any case, buffering unprojected data is not recommended.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;edit: actually, buffering geographic data results in geodesic buffers, which are more accurate than Euclidean buffers made for projected data.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 21:54:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/selectlayerbylocation-within-a-distance-from-point/m-p/430517#M33834</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2013-06-20T21:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: SelectLayerByLocation 'WITHIN_A_DISTANCE' from point vs 'INTERSECT' point buffer</title>
      <link>https://community.esri.com/t5/python-questions/selectlayerbylocation-within-a-distance-from-point/m-p/430518#M33835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I assume it's because 'sitePntGeom' is assigned a geographic coordinate system (wgs1984SpatialRef), making oblong buffers, while SelectLayerByLocation may be using a projected coordinate system, making a circular search area. Is the feature class (centroidsFeatureClassName) projected? In any case, buffering unprojected data is not recommended.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Why is buffering unprojected data not recommended?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 22:01:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/selectlayerbylocation-within-a-distance-from-point/m-p/430518#M33835</guid>
      <dc:creator>CharlesArnold</dc:creator>
      <dc:date>2013-06-20T22:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: SelectLayerByLocation 'WITHIN_A_DISTANCE' from point vs 'INTERSECT' point buffer</title>
      <link>https://community.esri.com/t5/python-questions/selectlayerbylocation-within-a-distance-from-point/m-p/430519#M33836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Oh, on further inspection apparently &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000800000019000000"&gt;buffering geographic data&lt;/A&gt;&lt;SPAN&gt; is &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;preferred &lt;/SPAN&gt;&lt;SPAN&gt;(news to me) in order to avoid distortions introduced by the projection. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I still feel like this is the cause of the difference in selected points, although now I'm questioning everything.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 22:13:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/selectlayerbylocation-within-a-distance-from-point/m-p/430519#M33836</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2013-06-20T22:13:33Z</dc:date>
    </item>
  </channel>
</rss>

