Calculate distance and set geofence based on it