从纬度/长度和距离获取边界框 [英] Get Bounding Box from lat/long and distance

查看:104
本文介绍了从纬度/长度和距离获取边界框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用twitter stream api为我的ios项目。 Stream API具有位置参数。如何从用户位置(纬度/经度)和1km距离获得边界框坐标? MapKit或数学函数中是否有API或工具?

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 ?

输入

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

输出

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


推荐答案

是的,请查看< MapKit / MKGeometry中的函数。 h> 喜欢 MKMetersPerMapPointAtLatitude(),它允许您将距离转换为地图点,然后将点映射到屏幕点。

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.

这篇关于从纬度/长度和距离获取边界框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆