Both are version 3
In this page the lat and lng are geberated at the client side and come on
the server side from $zoekaklat and $zoekaklng:
$naarposlat = $zoekaklat; // = 51.49457580000001
$naarposlng = $zoekaklng; // = 4.287162200000012
if($naarposlat==0 and $naarposlng==0) {
$zoekmessage2 = $arz_zoekmessage;
}
else {
$maxlat = $naarposlat + ( $zoekakafstand / (69 * 1.61)); // 69 miles per
degree of latitude
$minlat = $naarposlat - ( $zoekakafstand / (69 * 1.61));
$maxlng = $naarposlng + ( $zoekakafstand / ( 69.172 * 1.61 * cos(
$naarposlat * 0.0174533 ) ) );
$minlng = $naarposlng - ( $zoekakafstand / ( 69.172 * 1.61 * cos(
$naarposlat * 0.0174533 ) ) );
$ritten = "SELECT
*,(6366*acos(cos(radians(".$naarposlat."))*cos(radians(`naarpllat`))*cos(radians(`naarpllng`)-radians(".$naarposlng."))+sin(radians(".$naarposlat."))*sin(radians(`naarpllat`))))
AS verschil FROM ritten force index (naarpositie) WHERE vraag_aanbod like
'$ag' AND naarpllat < $maxlat AND naarpllat > $minlat AND naarpllng <
$maxlng AND naarpllng > $minlng AND vertrekdatum >= '$datum' HAVING verschil
<= $zoekakafstand";
This select statement is the echo of $ritten:
SELECT
*,(6366*acos(cos(radians(51.49457580000001))*cos(radians(`naarpllat`))*cos(radians(`naarpllng`)-radians(4.287162200000012))+sin(radians(51.49457580000001))*sin(radians(`naarpllat`))))
AS verschil FROM ritten force index (naarpositie) WHERE vraag_aanbod like
'A%' AND naarpllat < 51.6296014549 AND naarpllat > 51.3595501451 AND
naarpllng < 4.50350079762 AND naarpllng > 4.07082360238 AND vertrekdatum >=
'2011-07-12' HAVING verschil <= 15
This is from another page where the lat and lng are generated on the server
side:
$url = "
http://maps.googleapis.com/maps/api/geocode/xml?address=".urlencode($zoekpos2)."&sensor=false";
$geo = new SimpleXMLElement(file_get_contents($url));
usleep(1750000);
if ($geo->status == "OK") {
$naarposlat = $geo->result->geometry->location->lat; // = 51.4945758 in the
calculation this is handled as 51 ???
$naarposlng = $geo->result->geometry->location->lng; // = 4.2871622 in the
calculation this is handled as 4 ???
$maxlat = $naarposlat + ( $zoekafstand2 / (69 * 1.61)); // 69 miles per
degree of latitude
$minlat = $naarposlat - ( $zoekafstand2 / (69 * 1.61));
$maxlng = $naarposlng + ( $zoekafstand2 / ( 69.172 * 1.61 * cos(
$naarposlat * 0.0174533 ) ) );
$minlng = $naarposlng - ( $zoekafstand2 / ( 69.172 * 1.61 * cos(
$naarposlat * 0.0174533 ) ) );
$ritten = "SELECT
*,(6366*acos(cos(radians(".$naarposlat."))*cos(radians(`naarpllat`))*cos(radians(`naarpllng`)-radians(".$naarposlng."))+sin(radians(".$naarposlat."))*sin(radians(`naarpllat`))))
AS verschil FROM ritten force index (naarpositie) WHERE vraag_aanbod like
'$ag' AND naarpllat < $maxlat AND naarpllat > $minlat AND naarpllng <
$maxlng AND naarpllng > $minlng AND vertrekdatum >= '$datum' HAVING verschil
<= $zoekafstand2";
This select statement is the echo of $ritten:
SELECT
*,(6366*acos(cos(radians(51.4945758))*cos(radians(`naarpllat`))*cos(radians(`naarpllng`)-radians(4.2871622))+sin(radians(51.4945758))*sin(radians(`naarpllat`))))
AS verschil FROM ritten force index (naarpositie) WHERE vraag_aanbod like
'A%' AND naarpllat < 51.1350256549 AND naarpllat > 50.8649743451 AND
naarpllng < 4.2140244802 AND naarpllng > 3.7859755198 AND vertrekdatum >=
'2011-07-12' HAVING verschil <= 15
So, in my opinion the input is the same, the formulas are the same and the
outcome is different. Thats is because the lat and lng are handled in the
calcultation as integers without decimals.
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-maps-js-api-v3/-/--UZCHqshpIJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.