I have a bunch of coordinates(lat and lon) in the database, and I would like to check if there have coordinates inside the certain radios circle area. I think there has a range of latitude and longitude, and I can filter the data in the SQL query statement.
The code will be something like the below,
center_point = ["37.7577627", "-122.4726194"] #lat and lon
radios = 5 #kilometer
range = someFunction(radios, center_point)
#it return a maximum and minimum of lat and lon as tuple
lat1, lat2, lon1, lon2 = range[0], range[1], range[2], range[3]
sql_statement = "SELECT * FROM tables WHERE latitude BETWEEN lat1 AND lat2 AND longitude BETWEEN lon1 AND lon2;"
I do found a similar solution, but this is not what I prefer. How to check if coordinate inside certain area Python