Check store distance for lending decisions

Enter the store’s position and the phone’s, or load a file of applications. See the distance in metres and which applications are beyond the trigger.

Two positions

Store position

Phone position

Paste a latitude and longitude pair copied from a map into the latitude field to fill both fields.

This trigger applies to the pair above and every row in the file below.

The store is the camera shop in Zamalek from the video below, and the photo with the application was taken about 9 kilometres away.

Distance

9,029 m
Kilometres9.03 km
Trigger1,000 m
Beyond triggerYes

The phone was 9,029 m from the store, beyond the trigger of 1,000 m. That is a reason to look at the application. Distance alone does not show fraud.

Show working
φ1 = 30.0614° × π ÷ 180 = 0.524670    φ2 = 30.1426° × π ÷ 180 = 0.526088
Δφ = φ2 − φ1 = 0.001417    Δλ = (31.2197° − 31.2197°) × π ÷ 180 = 0.000000
a = sin²(Δφ ÷ 2) + cos φ1 · cos φ2 · sin²(Δλ ÷ 2) = 5.021191e-7
Distance = 2 · R · atan2(√a, √(1 − a)) = 2 · 6,371,000 · 0.000709 = 9,029 m
R = Earth’s radius = 6,371,000 m

Applications file

1,778 applications have a distance, and 22 rows were left out because a position was missing or not valid.

Your files are read in this browser and never uploaded. Only counts are sent if you request the result by email.

Optional stores file

If applications have a store ID instead of the store’s position, a file of stores with their ID, latitude and longitude fills it in.

These are 1,800 generated demo applications from 12 stores in Cairo, with one store where a third of the applications come from far away.

Applications beyond trigger

149
Share beyond8.4%
Median distance47 m
Stores with applications beyond12

149 of 1,778 applications came from a phone more than 1,000 m from the store. The stores table shows where they cluster.

Applications by distance band

Each bar shows the applications in one distance band, and red bars are beyond the trigger.

Store share beyond trigger

RankStoreAppsBeyond triggerShareMedian distance
1GIZ-H121464832.9%64
2CAI-N021491510.1%47
3CAI-D03148128.1%49
4CAI-A06147117.5%52
5CAI-Z14149117.4%52
6CAI-S08149106.7%54
7GIZ-O0114996.0%41
8CAI-M0715085.3%45
9CAI-C0414974.7%49
10CAI-D1114764.1%44

2 more stores are in the download.

Farthest applications

ApplicationStoreDistance, mBeyond trigger
APP-6188GIZ-O0136,641Yes
APP-5799GIZ-M0536,134Yes
APP-6634GIZ-H1234,956Yes
APP-5326CAI-M0734,834Yes
APP-6556GIZ-H1233,496Yes
APP-5978CAI-D1132,819Yes
APP-6660CAI-A0631,466Yes
APP-6689CAI-A0630,648Yes
APP-6597GIZ-H1230,548Yes
APP-5612CAI-N0229,834Yes
APP-6519GIZ-H1229,134Yes
APP-5315CAI-M0727,828Yes
APP-5166CAI-D0327,668Yes
APP-6641GIZ-H1225,983Yes
APP-6134GIZ-O0125,173Yes
APP-6625GIZ-H1224,068Yes
APP-5144CAI-Z1423,863Yes
APP-5654CAI-N0223,855Yes
APP-6401CAI-S0822,818Yes
APP-5212CAI-D0321,889Yes
APP-5355CAI-M0721,455Yes
APP-6511GIZ-H1221,217Yes
APP-6725CAI-A0620,932Yes
APP-5297CAI-D0319,897Yes
APP-6520GIZ-H1219,806Yes

1,753 more are in the download.

Get the result by email

Run the same distance check on every application at decision time, using the coordinates it already carries and a policy written in metres. Start free

Show the formula
φ = Latitude in radians    λ = Longitude in radians    R = Earth’s radius = 6,371,000 m
a = sin²(Δφ ÷ 2) + cos φ1 · cos φ2 · sin²(Δλ ÷ 2)
Distance = 2 · R · atan2(√a, √(1 − a))
Beyond trigger = Distance > Trigger distance

The distance is the shortest path along a sphere’s surface, not a road distance, and is only as accurate as the two positions, since a phone or photo can report a wrong one. A row with a missing or out-of-range position, or a position exactly 0, 0, is left out rather than read as a place.

Distance between GPS coordinates

The haversine formula works out the distance between two latitude and longitude positions along the surface of a sphere. Enter the store’s position and the phone’s, and the tool shows the distance in metres and kilometres.

The distance can help you see whether a customer’s phone was near the store when they applied. Set a trigger distance to review applications beyond it, then use the same check across a file of applications.

Distance questions

How do I calculate the distance between two GPS coordinates?

The haversine formula uses the latitude and longitude of both positions to calculate the distance along a sphere’s surface. This tool shows the result in metres and kilometres.

What is the haversine formula?

It is a formula for calculating the distance between two positions from their latitude and longitude. The tool shows the working with the numbers you entered.

How far was a customer from the store when they applied?

Enter the store’s position and the phone’s position to see the distance between them. The result is along the surface of a sphere and depends on the accuracy of both positions.

What distance should I use for a store location check?

Set a trigger distance in metres for the check. An application beyond it is a reason to review, and the distance alone does not establish fraud.

How does haversine compare with the spherical law of cosines?

This tool uses haversine to work out the distance. The related article sets that formula beside the spherical law of cosines.