From 2ca3372e3110e604310b86a456e20a5d0a1e8fb7 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 25 May 2022 12:34:55 -0400 Subject: [PATCH] ProximityQuery - Remove unused code --- CRM/Contact/BAO/ProximityQuery.php | 42 ------------------------------ 1 file changed, 42 deletions(-) diff --git a/CRM/Contact/BAO/ProximityQuery.php b/CRM/Contact/BAO/ProximityQuery.php index b864f1eae0..f4a671b807 100644 --- a/CRM/Contact/BAO/ProximityQuery.php +++ b/CRM/Contact/BAO/ProximityQuery.php @@ -88,45 +88,6 @@ class CRM_Contact_BAO_ProximityQuery { return 1.0 / sqrt($x * $x + $y * $y); } - /** - * Convert longitude and latitude to earth-centered earth-fixed coordinates. - * X axis is 0 long, 0 lat; Y axis is 90 deg E; Z axis is north pole. - * - * @param float $longitude - * @param float $latitude - * @param float|int $height - * - * @return array - */ - public static function earthXYZ($longitude, $latitude, $height = 0) { - $long = deg2rad($longitude); - $lat = deg2rad($latitude); - - $cosLong = cos($long); - $cosLat = cos($lat); - $sinLong = sin($long); - $sinLat = sin($lat); - - $radius = self::$_earthRadiusSemiMajor / sqrt(1 - self::$_earthEccentricitySQ * $sinLat * $sinLat); - - $x = ($radius + $height) * $cosLat * $cosLong; - $y = ($radius + $height) * $cosLat * $sinLong; - $z = ($radius * (1 - self::$_earthEccentricitySQ) + $height) * $sinLat; - - return [$x, $y, $z]; - } - - /** - * Convert a given angle to earth-surface distance. - * - * @param float $angle - * @param float $latitude - * @return float - */ - public static function earthArcLength($angle, $latitude) { - return deg2rad($angle) * self::earthRadius($latitude); - } - /** * Estimate the min and max longitudes within $distance of a given location. * @@ -214,9 +175,6 @@ class CRM_Contact_BAO_ProximityQuery { public static function where($latitude, $longitude, $distance, $tablePrefix = 'civicrm_address') { self::initialize(); - $params = []; - $clause = []; - list($minLongitude, $maxLongitude) = self::earthLongitudeRange($longitude, $latitude, $distance); list($minLatitude, $maxLatitude) = self::earthLatitudeRange($longitude, $latitude, $distance); -- 2.25.1