As a follow-on to the answer provided by blah238 to this question.
So I'm working in maps with units of meters, and I convert 96 DPI as follows, but I don't seem to be able to click on anything when zoomed beyond a certain scale?
def get_srch_distance_metres(scale, selection_tolerance=3):
""" returns the map distance in metres that corresponds to the input
selection tolerance in pixels (default 3) at the specified map scale"""
# DPI used by ArcMap when reporting scale (96.0 DPI = 3779. Dots Per Metre)
return scale * selection_tolerance / 3779.527559055
1 Answer 1
Solved this! It wasn't working when zoomed in. The reason being was that I was accidentally rounding the search distance to an integer when passing it as a value in a subsequent call to arcpy.SelectLayerByLocation_management. The part after the decimal place obviously becomes more and more important as you zoom in! So the above should work for metric units.