我怎么能找到使用GPS位置从数据库中的两个地理点之间波普(MySQL的)? [英] how can i find pople between two geo points using gps locations from database(mysql)?

查看:190
本文介绍了我怎么能找到使用GPS位置从数据库中的两个地理点之间波普(MySQL的)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要做出的android应用程序中,用户可以输入的两个地理点(lat和长),并与这两点我想要查询的数据库表(MySQL的),其中已经存储与GPS定位人民的信息(经纬度长),其中通过使用上述查询我想搜索输入起点和终点之间的人。

I want make an application in android in which user can input two geo points(lat and long) and with these two points i want to make query in database table(mysql) where already peoples information stored with their gps location(lat and long) where by using the above query i want to search people between inputted starting and ending point.

例如:用户A已经输入的出发点:德里和终点:孟买,现在他会点击搜索按钮和所有人民来孟买和德里之间的GPS位置。如果它是更多钞票。所有peole将显示为列表视图。

For example : User A has inputted starting point : Delhi and Ending point : Mumbai and now he will click on the search button and all peoples comes whose gps location between mumbai and delhi. If is it posible. All peole will displays as listview.

希望你明白我已经解释以及..
请有人告诉我如何才能做到这一点的方法吗?读音字使用PHP MySQL作为后端。

hope i have explained well as you understand.. Please somebody tell me the way how can i achieve this ? i m using php mysql as backend.

推荐答案

如果你想知道是谁在两点划定的正方形区域必须检查的人的位置是两个点'的纬度和经度之间。例如:

If you want to know who is in the square area delimited by two points you must check whether the position of the people is between both points' latitude and longitude. Example:

//Delimiting points:
    Dehli:    28°36′36″N 77°13′48″E
    Mumbai:   18°58′30″N 72°49′33″E

//People:
    Person A: 28°40′52″N 73°21′47″E
    Person B: 22°03′44″N 75°56′11″E

Person A is OUTSIDE the square area between Dehli and Mumbai because the latitude
he is on is greater than the greatest latitude of both points:
    Mumbai lat. < Dehli lat. < Person A lat.

Person B is INSIDE the square area between Dehli and Mumbai because the latitude
and longitude he is on is between both points latitude and longitude:
    Mumbai lat. < Person B lat. < Dehli lat.
    Mumbai lon. < Person B lon. < Dehli lon.

如果你想计算距离,你可以依靠大圆公式。这可能为了找到在X-方圆百里左右的人使用。

If you want to calculate distances, you can rely on the Great Circle Formula. This could be used in order to find people in an X-miles radius or so.

这篇关于我怎么能找到使用GPS位置从数据库中的两个地理点之间波普(MySQL的)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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