lundi 2 novembre 2015

how to get latitude and longitude data in 50km radius from sqlite, by passing center point latlng in android

Currently i am just adding and subtracting the current lat lng by .0005. but its not giving the correct 50Km radius datas. I am beginner in this.

double lat1 = lat+.0050;
double lat2 = lat-.0050;

double lng1 = lng+.0050;
double lng2 = lng-.0050;

select * from table where (lat between lat1 and lat2) and (lng between lng1 and lng2)

Aucun commentaire:

Enregistrer un commentaire