简体   繁体   English

过滤由于用户当前位置而导致的位置数据库的半径

[英]Filter a database of locations due to user's current location with radius

Hey guys i'm developing a specific android app which has a BigData of locations all over a country,i want to filter those locations due to user's current location with a radius. 大家好,我正在开发一个特定的android应用,该应用在一个国家/地区具有BigData位置信息,我想根据用户当前所在的半径来过滤这些位置信息。

To clarify my purpose my user is a car driver that chooses a random road on Google Map by specifying the start and the end point using Markers then i draw a road between those points using Google API 为了说明我的目的,我的用户是一位汽车驾驶员,他通过使用Markers指定起点和终点在Google Map上选择了一条随机道路,然后我使用Google API在这些点之间绘制了一条道路

What i want to do is getting the locations from my database that lies on the selected road only so i thought of filtering my database locations due to user's current location and give it a radius which is the distance on the road(the distance between the two Markers chosen by the user) and start showing them on the map. 我想做的是从我的数据库中获取仅位于所选道路上的位置,因此我想到了根据用户的当前位置过滤数据库位置,并为其指定半径作为道路上的距离(两者之间的距离)用户选择的标记),然后开始在地图上显示它们。

Note:I thought of comparing the locations in my database with the user's current location, If it is shorter than the radius(the distance between the two Markers) then i will add it to my filtration result 注意:我考虑过将数据库中的位置与用户的当前位置进行比较,如果它比半径(两个标记之间的距离)短,那么我会将其添加到过滤结果中

but i think it's a mess i have a BigData and it would take too much time to compare. 但我认为拥有BigData实在是一团糟,比较起来需要太多时间。

Is there any algorithm or API that Google Maps Provides for this problem that i can use to filter? Google Maps是否提供可用于过滤此问题的算法或API? even if it's written in a web programming language i can create a web service to handle it and send it to my application. 即使它是用Web编程语言编写的,我也可以创建一个Web服务来处理它并将其发送到我的应用程序。

Use KD-tree K nearst neighbours, to filter the points that are away from the car. 使用附近的KD树K过滤远离汽车的点。 and that's log N time complexity. 这就是N倍的时间复杂度。 but inserting into the tree is N*log N 但是插入树是N * log N

I have find a solution for my problem 我找到了解决我问题的方法

In my application i'm using Firebase as cloudbacked and fortunately it has a library that performs GeoQueries called GeoFire it's documentation is here 在我的应用程序中,我使用Firebase作为云备份,幸运的是,它具有一个执行GeoQueries的库,称为GeoFire,其文档在此处

It can create a query of all saved locations in Firebase due to a specific location by a radius in milliseconds which is what i really need 由于特定的位置(以毫秒为单位的半径),它可以创建Firebase中所有保存位置的查询,这正是我真正需要的

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 根据用户当前位置查询位置数据库 - Query a location database based on the user's current location 在相对于当前用户位置的Google地图中(在一组给定坐标中)查找具有最接近坐标的位置 - Finding locations with the closest coordinates in google maps(out of a set of given ones) relative to current user's location 调用 MySQL 中的 function 过滤掉用户当前位置附近的餐厅 - Call a function in MySQL to filter out the restaurants which are near to the user's current location 在距数据库一定半径范围内的位置的API - API for locations within a certain radius from database 获取用户当前位置的经纬度 - Fetch latitude and longitude on user's current location 如何让谷歌地图api获取用户的当前位置以将其存储在数据库中? - How to make google maps api get user's current location to be stored it in the database? 使用Google Maps API DistanceMatrixService计算API中当前位置和用户位置之间的距离 - Calculate the distance between my current location and user locations from API with Google Maps API DistanceMatrixService 根据用户的位置查询数据库值 - Query database values based on user's location 在给定半径内显示数据库中的所有位置 - Display all locations from database within a given radius 通过传递不同的当前位置及其周围位置(POI)纬度来绘制位置? - Draw locations by passing a different current location and the location around it (POIs) wikitude?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM