如何进行基于位置的搜索

发布于 2024-07-14 18:28:40 字数 145 浏览 9 评论 0原文

我需要开发一种解决方案,使用户能够根据城市和州进行搜索。 用户应该能够请求搜索结果不仅包括该城市和州的匹配项,还包括 25、50、100 英里半径内的匹配项。 我看到招聘网站做这种事情。 这是如何完成的?是否有供应商为其提供开放 API?

谢谢

I need to develop a solution that will provide the ability for a user to search based on a city and state. The user should have the ability to request that the search results include not just matches for that city and state, but also include matches in a 25, 50, 100 mile radius. I see that job sites do this type of thing. How is this done and are there vendors that provide open API's for it?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

流殇 2024-07-21 18:28:41

看来您正在寻找的是一个 GIS(地理信息系统),其中每条(或某些)信息都与其地理位置相关联。 此类系统允许对这些地理位置执行空间搜索,例如。 “给我提供距此位置 5 英里半径范围内销售特定产品的所有商店”(也可以结合空间搜索和传统搜索)。

现在您可以使用一些技术示例:

  1. PostgreSQL + Postgis:这种数据库和地理扩展的开源组合足以满足大多数基本用户需求。 您可以从这里开始
  2. MySql Spatial
  3. Oracle Spatial
  4. ArcSde (ESRI)< /a>

It seems that what you're looking for is a GIS (Geographical Information System) in which each (or some) piece of information is linked to its geographical location. Such sistems allow to perform spatial searches on those geographical location, eg. "give me all stores in a 5 mile radious from this position which sells a specific product" (combining spatial and traditional searches is also possible).

Now some examples of technologies you can use:

  1. PostgreSQL + Postgis: This opensource combination of database and geographical extension is powerful enough for most of basic user needs. You can start from here
  2. MySql Spatial
  3. Oracle Spatial
  4. ArcSde (ESRI)
野味少女 2024-07-21 18:28:41

您需要从城市、州和邮政编码及其相应纬度和经度的数据库开始。 这里有一个链接,您可以在该网站上免费下载此类数据库。

接下来,您需要一种算法来查找哪些城市/邮政编码位于用户输入的城市/邮政编码的 X 英里半径范围内。 这是另一个链接,应该解释如何执行此操作。

You'll want to start with a database of cities, states and zip codes with their corresponding latitude and longitude. Here's a link to a site where you can download such a database for free.

Next you'll need an algorithm to find which cities/zip codes are within an X mile radius of the city/zip the person entered. Here's another link that should explain how to do that.

盗琴音 2024-07-21 18:28:41

您可能想查看GeoNames

我为 GeoNames 编写了一个 .NET WCF 客户端,可在此处获取。

You might wanna have a look at GeoNames.

I have written a .NET WCF client for GeoNames, available here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文