如何在 SQL Server 中对地址表进行最佳地理编码?
我有一个包含地址的 SQL Server 2008 表。我有一些 C# 代码可以单独对地址进行地理编码。我有一个用于地理编码的 Google 地图 API。现在我正在尝试找出使用这些资源的最有效方法。
我可以编写一个控制台应用程序,使用我的 C# 库手动更新表,但我拥有的数据会定期更新。我将执行某种导入例程,并且我认为在导入发生时执行地理编码将是“最简单的”。我对 SQL Server 功能不太了解,所以我正在寻求建议。
我考虑过让导入调用我创建的程序集,该程序集将在 SQL Server 中引用,但了解到 Sql Server 2008 几乎不可能引用您自己的 DLL。因此,我的下一个猜测是让导入调用 Web 服务来传递地址并使用结果更新表,但我没有找到有关此方法的信息。有什么建议吗?
I've got a SQL Server 2008 table with addresses. I've got some C# code that can individually geocode the addresses. I've got a Google Maps API for geocoding. Now I'm trying to figure out the most efficient way to use these resources.
I could write a console app that manually updates the tables using my C# library, but the data I have is updated periodically. I will be performing an import routine of some sort and I'm thinking it would be 'simplest' to perform the geocoding as the import occurs. I'm not so strong on SQL Server capabilities, so I'm looking for advice.
I've considered letting the import call an assembly I create that would be referenced in SQL Server, but read that Sql Server 2008 has made it virtually impossible to reference your own DLL. So my next guess is having the import call a web service to pass in the address and update the table with the results, but I've not had much luck in finding info on this method. Any advice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Google 地图有一个允许地理编码的 WebService API。您的地址量应该是可接受的数量(我认为谷歌允许在使用一段时间后每 5 秒进行一次地理编码)。请注意,您必须将地理编码作为插件与应用程序解耦,因为如果不是 Google 客户,则无法在商业应用程序中实现它。
Google Maps has a WebService API that allows Geocoding. Your Volume of addresses should be an acceptable amount (I think google allows one geocode per 5 seconds after a while of using it). Be aware that you have to decouple the geocoding as a plugin from your application, because you cannot implemented it in ta commercial application without being a google customer.