I have a database SQLite with 10,000 recond with the following fields :
- name (string)
- latitude (double)
- longitude (double)
Should I select only the first 5 records sorted by distance (closest) to a point where I know the coordinates (lat 44.111 long 7.222).
I saw that the implementation of the Android SQLite does not allow you to use the functions acos and cos.
I turned then to the library Warwound Spazialite as well as its GUI but I have not figured out how to use it. I could not find a function "distance" I know how to use the functions acos, and cos in a similar formula
Select TOP 5 Name, distance As ((radians (ACOS (SIN (radians (44.111)) * Sin (radians (Latitude)) + Cos (radians (44.111)) * COS (radians (Latitude)) * COS (radians (7.222 - Longitude))))) * 69.09) FROM TabWaypoints
Thanks for any help and suggestion.
- name (string)
- latitude (double)
- longitude (double)
Should I select only the first 5 records sorted by distance (closest) to a point where I know the coordinates (lat 44.111 long 7.222).
I saw that the implementation of the Android SQLite does not allow you to use the functions acos and cos.
I turned then to the library Warwound Spazialite as well as its GUI but I have not figured out how to use it. I could not find a function "distance" I know how to use the functions acos, and cos in a similar formula
Select TOP 5 Name, distance As ((radians (ACOS (SIN (radians (44.111)) * Sin (radians (Latitude)) + Cos (radians (44.111)) * COS (radians (Latitude)) * COS (radians (7.222 - Longitude))))) * 69.09) FROM TabWaypoints
Thanks for any help and suggestion.