However, there is no guarantee that the exact coordinates they entered will be in the .csv file, so I need to choose the closest coordinates. To do this, I would like to pull all coordinate pairs that are like the input coordinates and place them into an array (i.e. if the coordinates are entered to 6 significant figures, I would truncate it to 4 sig figs and find all coords that share those first sig figs.)
Up until now I have been doing this with mySQL. I imported the .csv file into mySQL and had a huge table in my database. Well, now I have about 30 other tables just like it (oh, sweet growth!) that I need to use as well. I don't want to have a huge mySQL database, so I'd prefer to put the .csv files into a folder on the server and just pull from them instead. Here is a basic summary of how I pull the data from mySQL:
Code: Select all
$lat=$_GET['lat'];
$lon=$_GET['lon'];
$latRound=round($lat,1);
$lonRound=round($lon,0);
$sql="SELECT * FROM coordData WHERE latitude LIKE '$latRound%' AND longitude LIKE '$lonRound%'";
$result=mysql_query($sql,$conn);