Get Bounding Box from lat/long and distance

情到浓时终转凉″ 提交于 2019-12-11 16:16:46

问题


Im using twitter stream api for my ios project. Stream API has a location parameter. How can i get bounding box coordinates from user location(lat/long) and 1km distance ? Is there any API or tool in MapKit or mathematical functions ?

Input

(latitude = 37.785834, longitude = -122.406417)
Distance = 1000 meter

Output

latMin: 37.789934 longMin : -122.416417
latMax: 37.787834  longMax : -122.396417

回答1:


Yep, check out the functions in <MapKit/MKGeometry.h> like MKMetersPerMapPointAtLatitude(), which will allow you to convert distance to map points, then map points to screen points.



来源:https://stackoverflow.com/questions/24632675/get-bounding-box-from-lat-long-and-distance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!