Hello,
I have a database on my mysql server that consists 2000 points with lat,lon values. What I want to do is , calculate point A 's distance to this 2000 points and put them in an array so i can get it via json. I searched the internet and found some calculation codes for php but they basicly calculates distance between two points. Is it possible to adapt those codes so that they can calculate all the distance for 2000 different points ? ,
An example code is here : https://www.geodatasource.com/developers/php
The sql query i will use in my php will start like this :
this code just gives mt he json of all places lat,lon values of course. What i want to do is run the function somewhere in this code and print all points lat lon values to a specific point via json. But i dont know how to modify my php code to run above function to print all the 2000 distances to my point as json.
Can you help me about it ?
TY
I have a database on my mysql server that consists 2000 points with lat,lon values. What I want to do is , calculate point A 's distance to this 2000 points and put them in an array so i can get it via json. I searched the internet and found some calculation codes for php but they basicly calculates distance between two points. Is it possible to adapt those codes so that they can calculate all the distance for 2000 different points ? ,
An example code is here : https://www.geodatasource.com/developers/php
The sql query i will use in my php will start like this :
B4X:
$q = "SELECT latitude_deg,longitude_deg,id FROM places;
$r = mysql_query($q);
$all = array();
while(($row = mysql_fetch_assoc($r))) {
$all[] = $row;
}
print json_encode($all);
this code just gives mt he json of all places lat,lon values of course. What i want to do is run the function somewhere in this code and print all points lat lon values to a specific point via json. But i dont know how to modify my php code to run above function to print all the 2000 distances to my point as json.
Can you help me about it ?
TY
Last edited: