Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
6425574f
Unverified
Commit
6425574f
authored
2 years ago
by
Eileen McNaughton
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #23581 from colemanw/removeUnused
ProximityQuery - Remove unused code
parents
c7855ead
2ca3372e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Contact/BAO/ProximityQuery.php
+0
-42
0 additions, 42 deletions
CRM/Contact/BAO/ProximityQuery.php
with
0 additions
and
42 deletions
CRM/Contact/BAO/ProximityQuery.php
+
0
−
42
View file @
6425574f
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment