Skip to content
Snippets Groups Projects
Unverified Commit 6425574f authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #23581 from colemanw/removeUnused

ProximityQuery - Remove unused code
parents c7855ead 2ca3372e
Branches
Tags
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment