4

I have a little problem using Android.

I have my GPS position, clearly latitude and longitude, and a ray of search in meters (for example 100 meters), ok?

Imagin my position at center of the circle made by ray, I would know how to obtain on Android the: topLeft Latitude topLeft Longitude bottomLeft Latitude bottomLeft Longitude

of the rectangle that inscribes the circle.

Thank's in advance.

1 Answers1

0

1) Convert center lat long to cartesisan x,y in meters: (lat lon are on a sphere, x,y is a flat map then you can continue with school mathematics

2) use polar coordinates formula to create the 4 corner points
the first corner has angle 45 degrees, and r = 100m
second corner of the square has angle 45 + 90 degrees

3) convert back the 4 cartesian meter coordinates to lat,lon

a bit more detailed here How to find a set of lat/long pairs surrounding a 5 miles radius of a certain location

and see my answer here

PHP: How to create a Geo-Fence(bounding Box) using the Distance from a set of Coords

Community
  • 1
  • 1
AlexWien
  • 28,470
  • 6
  • 53
  • 83