【发布时间】:2016-06-24 05:08:16
【问题描述】:
目前我发现的最好的解决方案是,
using Two10.CountryLookup;
var lookup = new ReverseLookup();
try
{ // get country details based on lat/long
var country = lookup.Lookup(float.Parse(scandata.gpslat), float.Parse(scandata.gpslong));
string cName = country.name;
string cCode = country.code;
}
catch(Exception e)
{
Console.WriteLine("Exception :"+e);
}
但是这个物体太重了,我有几百万条记录要处理。这个对象使我的脚本变慢。还有其他更快的方法吗?
【问题讨论】:
-
什么是
ReverseLookup?这是什么来的? -
您是否正在为要查找的每条记录创建一个新的 ReverseLookup 实例?
-
@TheAnathema github.com/two10degrees/Two10.CountryLookup
-
使用 Google Geocoding API 怎么样,比如this?
-
@ChrisS Hes 试图定位数百万条记录。进行网络查找会很慢。
标签: c# geolocation