Given GPS of ppoint1 and distance and angle of point2 from point1 , find GPS of point2 iOS [closed]

StackOverflow https://stackoverflow.com/questions/16633918

  •  29-05-2022
  •  | 
  •  

Question

I have a MapImage with 20 points. I know (x,y) of all points on the map image. I also know the GPS lat and long of two of the points.Using this information I need to calculate GPS lat and long for remaining 18 points. I have to implement this for an iPhone application. Any idea how i could do this ?

Was it helpful?

Solution

Sounds like you want MKMapView's -convertPoint:toCoordinateFromView:, which makes exactly the {x,y}->{lat,long} conversion that you're looking for.

OTHER TIPS

If you're dealing with a small scale map, e.g. a map of a town or city rather than the map of a continent, then you just need to know how many of your horizontal image units correspond to one degree of longitude, and how many of your vertical image units correspond to one degree of latitude. See my answer here for how to work out the correspondence between latitude and longitude and distance in metres. The same conversions should help for latitude and longitude into your image units too. However, if either of two points where you know both (x,y) and (latitude,longitude) have the same x or the same y, then this won't work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top