如何准备用于位置感知搜索的现有数据库?

编程入门 行业动态 更新时间:2024-10-22 21:27:34
本文介绍了如何准备用于位置感知搜索的现有数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

要求:我目前正在制作一个拥有30000条记录的应用程序。要求是有基于位置/感知搜索。例如。距离我目前的地点不到5米。

此服务将如何访问:此服务可通过网络和iOS 应用访问。

开发平台:

  • Web:Cakephp ,php和python
  • DB:MySql
  • iOS:objective-c
  • 当前正在使用的外部库:Google Maps Javascript Api v3

基于位置的搜索

我一直在做这方面的一些研究,我将采用 Haversine Formula 为此。但是为了使Haversine公式有效,我需要为我的数据库中的所有记录反向地理代码。 我曾经使用过的唯一反向地理编码服务来自Google,我知道他们不会在没有在他们的地图上显示结果的情况下允许这一点。

注意:地理编码API只能与Google地图一起使用;禁止在地图上显示地理编码结果。

  • 是否有其他可用的API或服务以反转地理代码所有这些记录?
  • 30000是一个很大的数字。我显然会在一段时间内使用cron job,但由于这个请求将来自同一个IP,这可能是一个问题吗?
  • 对此有任何帮助将不胜感激。

    更新1#

    我发现这个SO问题,建议 OpenStreetMap Nominatim

    解决方案

    您可以使用各种地理编码服务,但您很可能必须付费。查看。他们可能会为你的情况而努力。如果这是一个商业冒险,那么花点钱可能会更好,并确保您获得良好的数据。

    30,000条记录不会花那么长时间。如果没有速率限制,它应该能够在10-20分钟内完成。我一次对一页2000个记录进行了地理编码(每页100个),花费了5分钟时间。

    后来,我建立了位置管理界面。它没有完成,代码也不是最好的,但它可能会给你一个起点。它使用谷歌地理编码,但可以很容易地换出任何其他服务。

    galengrover/projects/Store-Locator-Admin/

    github/galen/Store-Locator-Admin

    Requirement : I am currently working on an app that has over 30000 records. The requirement is to have location based/aware searching. For eg. within 5mi from my present location.

    How will this service be accessed : This service will be accessed from both web and iOS app.

    Development platforms :

    • Web : Cakephp, php and python
    • DB : MySql
    • iOS : objective-c
    • External libraries currently being used : Google Maps Javascript Api v3

    Location based searching

    I have been doing some research on this subject, and I will be employing Haversine Formula for this. But for Haversine formula to be effective, I need to have reverse geo code for all my records in my DB. The only reverse geocoding service I have ever used is from Google, and I know for a fact that they don't allow this without displaying the results on their map.

    Note: the Geocoding API may only be used in conjunction with a Google map; geocoding results without displaying them on a map is prohibited.

  • Are there other APIs or services I can use to reverse geo code all those records ?
  • 30000 is a large number. I will obviously be employing cron job for this over a period of time, but as this request will be from same IP, can this be an issue ?
  • Any help on this will be highly appreciated.

    Update 1 #

    I found this SO question which recommends OpenStreetMap Nominatim

    解决方案

    There are all kinds of geocoding services you can use, but you'll most likely have to pay. Check out Cloudmate. They might work out for your situation. If this is a business venture it might be better to spend a little bit of money and make sure you get good data.

    30,000 records wont take that long at all. If there's no rate limit it should be able to be done in 10 - 20 minutes. I've geocoded 2000 records one page at a time(100 on each page) and it took 5 minutes.

    A while back I built a locations administration interface. It's not finished and the code is not the greatest but it may give you a starting point. It uses google to geocode but can easily be swapped out for any other service.

    galengrover/projects/Store-Locator-Admin/

    github/galen/Store-Locator-Admin

    更多推荐

    如何准备用于位置感知搜索的现有数据库?

    本文发布于:2023-06-13 17:34:21,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/686618.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:位置   数据库

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!