4

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

4

3 回答 3

3

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.

于 2009-03-05T16:06:02.577 回答
3

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

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

  1. PostgreSQL + Postgis:这种数据库和地理扩展的开源组合足以满足大多数基本用户需求。你可以从这里开始
  2. MySql 空间
  3. 甲骨文空间
  4. ArcSde (ESRI)
于 2009-03-05T16:24:32.483 回答
0

您可能想看看GeoNames

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

于 2009-03-10T18:53:53.003 回答