I have latitude and longitude of a current location. I want to check if target location (latitude and longitude) is close with 50 meter radius to the current location.
I am new to android.if anyone have solution about this.please reply.
Get the coordinates of a placeOn your computer, open Google Maps. Right-click the place or area on the map. This will open a pop-up window. You can find your latitude and longitude in decimal format at the top.
A circle of latitude at latitude lat=1.3963 rad has the radius Rs = R · cos(lat) = 1106 km, so d=1000 km now corresponds to an angular radius of rs = d/Rs = d/(R · cos(lat)) = 0.9039. Hence, covering d=1000 km on a circle of latitude gets you to longitude lonS = lon ± d/(R · cos(lat)) = -0.6981 rad ± 0.9039 rad.
Get Coordinates on Android To obtain coordinates for a location on Android, you'll drop a pin. Tap and hold a spot on the map. You'll see a red pin appear on the map and a Dropped Pin window at the bottom. The coordinates for the pinned location appear in the Search box at the top.
use the built in distance calculation:
Location loc;
.....
float radius = 50.0;
float distance = loc.distanceTo(loc2);
if (distance < radius) then inside.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With