Compute distance for geofence