# Calculating haversine versus checking latitude and longitude digits after decimal point?

If I want to tell whether 2 points are close to each other, say at proximity of 50 meters, is it OK to compare both numbers up to a certain decimal point, for example the two points:

36.391155, -56.095878 and 36.391187, -56.095899

then checking if both points latitude and longitude are equal at the 4th decimal point, it's safe to say they are close, or there are cases where it won't work, and I must calculate haversine?

• Welcome to GIS SE! As a new user, please be sure to take the short tour to learn about this site's focused Q&A format.
– Andy
Jan 6 '19 at 22:42

• Assuming that you are already handling exceptions at the edges of the system, i.e. knowing that (-179.9999 ; 0) is as close to (179.9999 ; 0) as (-179.9997 ; 0).

• Assuming also that you handle the rounding of decimals. For example, the point (0.00019 ; 0) is closer to (0.0002 ; 0) than to (0.0001 ; 0).

• Assuming also that you understand that the distance between two points that differ by the same number of (decimal) degrees in one or both coordinates is not the same. That is, the point (0; 0.00016) is closer to (0; 0) than the (0.00014; 0.00014).

The only drawback I see is that the definition of "how close one point will be to the other" is variable. For example, the distance between (0 ; 89) and (1 ; 89) is extremely different from the distance between (0 ; 0) and (1 ; 0). Although both have the same difference in geographic coordinates (one degree of longitude).

It will not be possible to establish a distance constant value. Because the distance that separates two points of equal difference in geographical coordinates depends on their location in the sphere.

Therefore, something like "tell whether 2 points are close to each other, say at proximity of 50 meters" will not be possible without previously calculating the distance between both in terms of great-circle distance or minimum arc length of sphere between they.

I refer you to this really good Q&A here at GIS Stack Exchange: Measuring accuracy of latitude and longitude?