I want to select cities, which are within a distance of 200 km from my pre-selected city. However my result depends on whether I'm creating a buffer and use it to clip the cities (good result) or use the Select by Location analysis and supply it with the same data. My ArcGIS version is 10.2.1.

I figured out that the problem is that the analysis doesn't consider the data in a sphere (geographical) way, but in a planar (geometry) way. What I mean by that is, it calculates distance as in XY coordinates, so that the supposed buffer representing the distance has a perfect disk shape, which in Y direction is OK, however in X the results are tottaly wrong), meanwhile my data is geographical one and it uses deegrees (the data is in WGS84).

I made an experiment and created a buffer in PostGIS on the data imported as geometry, not geography and the result corresponds perfectly to the distance Select By Location uses. I've also created a buffer and used it to clip the cities and the result is correct.

I'm attaching the following files:

  • cities (a layer with some alaskan cities)
  • sel_city (a layer with a pre-selected city for the buffer)
  • city_buff200 (correct buffer create in ArcMap)
  • buff200_exp (buffer created in postgis, when data type was set as geometry and not geography) [this is a representation of the wrong distance buffer used by select by location]
  • cit_within200 (a layer with cities extracted using an incorrect distance representation)
  • cities_buff200_inter2 (correct result)

Data link: http://student.agh.edu.pl/~wysek/stack_data.rar

The code which I used to create the incorrect result is following:

cities_lyr = arcpy.mapping.Layer(cities)
arcpy.SelectLayerByLocation_management(cities_lyr, "WITHIN_A_DISTANCE", selected_city, "200 kilometers", "NEW_SELECTION")
arcpy.CopyFeatures_management(cities_lyr, "cit_withi200")
  • You need to project your data in PROJECTED coordinate system (not GEOGRAPHIC coordinate system, e.g. WGS84)
    – Learner
    Jan 26, 2015 at 12:29
  • 2
    @msi_g Is there any reason why I need to do that? The documentation stays dead silent about that and states: "This tool evaluates a spatial relationship in the coordinate system of the Input Feature Layer data source (the feature class on disk). Set the output coordinate system environment to evaluate the spatial relationship in a different coordinate system." from desktop.arcgis.com/en/desktop/latest/tools/…
    – Michal
    Jan 26, 2015 at 12:37

1 Answer 1


The Arc Select by location tool does not work so well for buffer analysis if your data is not projected (WGS 1984). It will draw the resulting buffer as a perfect circle shape, instead of a ovular shape by default (Euclidian vs. Geodesic).

The circle does not represent distances accuratly because it does not take into account the curvature of the earth, and will be incorrect when measured.

I would either project your data if you need to use select by location, or consider just using the buffer/clip method.

Here is some more reading about how the buffer tool does its thing. There is good information about how it draws the buffer and Euclidian vs. Geodesic


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.