PHP:如何使用一组坐标的距离创建地理围栏(边界框) [英] PHP: How to create a Geo-Fence(bounding Box) using the Distance from a set of Coords

查看:286
本文介绍了PHP:如何使用一组坐标的距离创建地理围栏(边界框)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用经纬度和距离来创建地理围栏(边界框)的点.

How would i create the points of a Geo-Fence(bounding box) using lat and lon and a distance.

我有中心点的纬度和经度 我有地理围栏的距离.

I have the lat and lon of the center point I have the geofence distance.

围绕这些多个点创建地理围栏的逻辑是什么?

What would the logic be to create the geo-fence around these multiple points?

感谢您的帮助.

推荐答案

如果您有一个纬度/经度点和一个距离,并且想要找到其他纬度/经度点,则称为方位范围问题.请参见网站

If you have a lat/lon point and a distance and you want to find other lat/lon points, this is called a bearing-range problem. See the section Destination point given distance and bearing from start point at the website http://www.movable-type.co.uk/scripts/latlong.html

如果要使盒子(栅栏)与赤道平行,则盒子东北角的方位角应为45度(在使用等式之前,别忘了转换为弧度).然后加90度获得下一个角点,直到完成所有4个点.

If you want the box (fence) parallel to the equator, then a bearing for the north-east corner of your box will be 45 degrees (don't forget to convert to radians before using the equations). Then add 90 degrees to get the next corner point until you have done all 4 points.

这篇关于PHP:如何使用一组坐标的距离创建地理围栏(边界框)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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