After multiple attempts to figure out how to find the closest gps point from the lat & lng fields (field_data_field_lat & field_data_field_lng) I would like to ask if such is possible? Is there any module that provides a solution with which it's able to create two fields for lat/lng and use them at views to find the closest one from an exposed filter?
I assume that there is no such ready made solution. In that case, I would like to write my custom sql statement for D7. Unfortunately, D7 doesn't support the D6 sql query functions and also the pager_query function.
Therefor I would like to write a statement that would bind the lat and lng fields and give back the nearest - closest gps points. Similar, one field statement is written at: http://www.techfounder.net/2009/02/02/selecting-closest-values-in-mysql/ where the union and ABS is used. I've found the union option but didn't figured out how to make the comparison for both fields within the D7 db sql layer.
Thank you in advance.