How would I go about converting an address or city to a latitude/longitude? Are there commercial outfits I can "rent" this service from? This would be used in a commercial desktop application on a Windows PC with fulltime internet access.
我如何将地址或城市转换为纬度/经度?我可以“租用”这项服务的商业服装吗?这将用于具有全时Internet访问权限的Windows PC上的商业桌面应用程序。
18 个解决方案
#1
46
Google has a geocoding API which seems to work pretty well for most of the locations that they have Google Maps data for.
谷歌有一个地理编码API,对于他们拥有谷歌地图数据的大多数地方来说,它似乎运行良好。
http://googlemapsapi.blogspot.com/2006/06/geocoding-at-last.html
They provide online geocoding (via JavaScript):
他们提供在线地理编码(通过JavaScript):
http://code.google.com/apis/maps/documentation/services.html#Geocoding
Or backend geocoding (via an HTTP request):
或后端地理编码(通过HTTP请求):
http://code.google.com/apis/maps/documentation/services.html#Geocoding_Direct
The data is usually the same used by Google Maps itself. (note that there are some exceptions to this, such as the UK or Israel, where the data is from a different source and of slightly reduced quality)
数据通常与Google地图本身使用的数据相同。 (请注意,有一些例外情况,例如英国或以色列,其数据来自不同的来源,质量略有降低)
#2
24
Nothing much new to add, but I have had a lot of real-world experience in GIS and geocoding from a previous job. Here is what I remember:
没有什么新东西可以添加,但我在以前的工作中有很多关于GIS和地理编码的实际经验。这是我记得的:
If it is a "every once in a while" need in your application, I would definitely recommend the Google or Yahoo Geocoding APIs, but be careful to read their licensing terms.
如果您的应用程序需要“每隔一段时间”,我肯定会推荐使用Google或Yahoo Geocoding API,但请务必阅读其许可条款。
I know that the Google Maps API in general is easy to license for even commercial web pages, but can't be used in a pay-to-access situation. In other words you can use it to advertise or provide a service that drives ad revenue, but you can't charge people to acess your site or even put it behind a password system.
我知道Google Maps API通常很容易获得商业网页的许可,但不能用于付费访问的情况。换句话说,您可以使用它来宣传或提供可以带来广告收入的服务,但您不能向人们收取费用来访问您的网站,甚至不能将其置于密码系统之后。
Despite these restrictions, they are both excellent choices because they frequently update their street databases. Most of the free backend tools and libraries use Census and TIGER road data that is updated infrequently, so you are less likely to successfully geocode addresses in rapidly growing areas or new subdivisions.
尽管存在这些限制,但它们都是很好的选择,因为它们经常更新街道数据库。大多数免费后端工具和库使用不经常更新的Census和TIGER道路数据,因此您不太可能在快速增长的区域或新的细分中成功地对地址进行地理编码。
Most of the services also restrict the number of geocoding queries you can make per day, so it's OK to look up addresses of, say, new customers who get added to your database, but if you run a batch job that feeds thousands of addresses from your database into the geocoder, you're going to get shutoff.
大多数服务还限制了您每天可以进行的地理编码查询的数量,因此可以查找添加到数据库中的新客户的地址,但是如果您运行的批处理作业可以从中提供数千个地址你的数据库进入地理编码器,你将被关闭。
I don't think this one has been mentioned yet, but ESRI has ArcWeb web services that include geocoding, although they aren't very cheap. Last time I used them it cost around 1.5cents per lookup, but you had to prepay a certain amount to get started. Again the major advantage is that the road data they use is kept up to date in a timely manner and you can use the data in commercial situations that Google doesn't allow. The ArcWeb service will also serve up high-resolution satellite and aerial photos a la Google Maps, again priced per request.
我不认为这个已被提及,但ESRI有ArcWeb网络服务,包括地理编码,虽然它们不是很便宜。上次我使用它们每次查询花费大约1.5美分,但你必须预付一定数量才能开始使用。同样,主要优势在于他们使用的道路数据能够及时更新,您可以在Google不允许的商业环境中使用这些数据。 ArcWeb服务还将提供Google地图上的高分辨率卫星和航空照片,并根据要求再次定价。
If you want to roll your own or have access to much more accurate data, you can purchase subscriptions to GIS data from companies like TeleAtlas, but that ain't cheap. You can buy only a state or county worth of data if your needs are extremely local. There are several tiers of data - GIS features only, GIS plus detailed streets, all that plus geocode data, all of that plus traffic flow/direction/speed limits for routing. Of course, the price goes up as you go up the tiers.
如果您想自己动手或可以访问更准确的数据,您可以从TeleAtlas等公司购买GIS数据订阅,但这并不便宜。如果您的需求非常本地化,您只能购买州或县的数据。有几层数据 - 仅GIS功能,GIS加上详细的街道,所有这些加上地理编码数据,所有这些都加上了路由的交通流量/方向/速度限制。当然,随着你上层,价格会上涨。
Finally, the Wikipedia article on Geocoding has some good information on the algorithms and techniques. Even if you aren't doing it in your own code, it's useful to know what kind of errors and accuracy you can expect from various kinds of data sources.
最后,*关于地理编码的文章提供了有关算法和技术的一些很好的信息。即使您没有在自己的代码中执行此操作,了解各种数据源可能出现的错误和准确性也很有用。
#3
11
Yahoo! Maps Web Services - Geocoding API accurately geocodes UK postcodes, unlike Google's API.
雅虎Maps Web Services - 与Google的API不同,地理编码API可准确地对英国邮政编码进行地理编码。
Unfortunately yahoo has deprecated this service, you could visit http://developer.yahoo.com/geo/placefinder/ for yahoo's service
不幸的是,雅虎已弃用此服务,您可以访问http://developer.yahoo.com/geo/placefinder/获取雅虎的服务
#4
10
试试这个:http://maps.googleapis.com/maps/api/geocode/json?address = 1600+Amphitheatre + Parkway,+ Mountain + View,+ CA&_sensor = false
more info here: http://code.google.com/apis/maps/documentation/geocoding/
有关详细信息,请访问:http://code.google.com/apis/maps/documentation/geocoding/
#5
5
When you convert an address or object to a lat/long it is called Geocoding.
将地址或对象转换为纬度/经度时,称为地理编码。
There are a lot geocoding solutions around. The solution right for your project will depend on the acceptability of the licensing terms of each geocoding solution. Both Microsoft Virtual Earth and Google Maps offer solutions which are free to use under a very restrictive licenses...
有很多地理编码解决方案。适合您项目的解决方案取决于每种地理编码解决方案的许可条款的可接受性。 Microsoft Virtual Earth和Google Maps都提供可在非常严格的许可下免费使用的解决方案......
http://code.google.com/apis/maps/documentation/services.html
#6
5
Having rolled my own solution for this before, I can whole heartedly recommend the Geo::Coder::US Perl module for this. Just download all the census data and use the included importer to create the Berkeley DB for your country and point the Perl script at it. Use the module's built in address parsing, and there you have it: An offline geocoding system!
我之前已经为此推出了自己的解决方案,我可以全心全意地推荐Geo :: Coder :: US Perl模块。只需下载所有人口普查数据并使用随附的导入程序为您所在的国家/地区创建Berkeley数据库,并将Perl脚本指向它。使用模块的内置地址解析,你就拥有它:一个离线地理编码系统!
#7
4
Try with this code, i work like this with addresses:
尝试使用此代码,我使用地址工作:
It is link in which with GET method you will send request and get lat and lng. http://maps.google.com/maps/api/geocode/json?address=YOUR ADDRES&sensor=false
这是与GET方法的链接,你将发送请求并获得lat和lng。 http://maps.google.com/maps/api/geocode/json?address=YOUR ADDRES&sensor = false
For exemple: http://maps.google.com/maps/api/geocode/json?address=W Main St, Bergenfield, NJ 07621&sensor=false
例如:http://maps.google.com/maps/api/geocode/json?address = W Main St,Bergenfield,NJ 07621&sensor = false
1. Create your GET method.
1.创建您的GET方法。
public static String GET(String url) throws Exception {//GET Method
String result = null;
InputStream inputStream = null;
try {
HttpClient httpclient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(url);
Log.v("ExecuteGET: ", httpGet.getRequestLine().toString());
HttpResponse httpResponse = httpclient.execute(httpGet);
inputStream = httpResponse.getEntity().getContent();
if (inputStream != null) {
result = convertInputStreamToString(inputStream);
Log.v("Result: ", "result\n" + result);
}
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
2. Create method for send request
2.创建发送请求的方法
@SuppressWarnings("deprecation")
public static String getLatLng(String accessToken) throws Exception{
String query=StaticString.gLobalGoogleUrl+"json?address="+URLEncoder.encode(accessToken)+"&sensor=false";
Log.v("GETGoogleGeocoder", query+"");
return GET(query);
}
gLobalGoogleUrl="http://maps.google.com/maps/api/geocode/"
3. Call method getLatLng
3.调用方法getLatLng
String result=getLatLng("W Main St, Bergenfield, NJ 07621");
4. Parse JSONObject
4.解析JSONObject
Now result is JSONObject with information about address and lan,lng. Parse JSONObject (result) with gson(). After that use lat,lng.
现在结果是JSONObject,其中包含有关地址和lan,lng的信息。使用gson()解析JSONObject(结果)。之后使用lat,lng。
If you have question about code , ask.
如果您对代码有疑问,请询问。
#8
2
You want a geocoding application. These are available either online or as an application backend.
您需要一个地理编码应用程序。这些可以在线获得,也可以作为应用程序后端使用。
-
Online applications:
- Google has a geocoding API
谷歌有一个地理编码API
-
Backend applications:
在线申请:Google拥有地理编码API
后端应用程序:GeoStan
#9
2
Maptsraction (http://www.mapstraction.com) lets you choose between any number of geocoding services. This could be helpful if you need to do large quantities, as I know Google has a limit to how many you can do a day.
Maptsraction(http://www.mapstraction.com)允许您在任意数量的地理编码服务之间进行选择。如果您需要大量购买,这可能会有所帮助,因为我知道Google每天可以执行的操作数量有限制。
#10
#11
2
You could also try the OpenStreetMap NameFinder (or the current Nominatim), which contains open source, wiki-like street data for (potentially) the entire world.
您还可以尝试使用OpenStreetMap NameFinder(或当前的Nominatim),它包含(可能)整个世界的开源,类似wiki的街道数据。
#12
1
you can use bing maps soap services, where you can reference reverse geocode service to find lat/long from address here is the link http://msdn.microsoft.com/en-us/library/cc980922.aspx
你可以使用bing maps soap服务,你可以在这里引用反向地理编码服务来查找lat / long来自这里的链接http://msdn.microsoft.com/en-us/library/cc980922.aspx
#14
0
You can use Microsoft's MapPoint Web Services.
您可以使用Microsoft的MapPoint Web服务。
I created a blog entry on how to convert an address to a GeoCode (lat/long).
我创建了一个关于如何将地址转换为GeoCode(lat / long)的博客条目。
#15
0
Thought I would add one more to the list. Texas A&M has a pretty decently priced service here: http://geoservices.tamu.edu/Services/Geocode/
以为我会在列表中添加一个。 Texas A&M在这里提供价格相当不错的服务:http://geoservices.tamu.edu/Services/Geocode/
A good option if you have a pretty large set of addresses to geocode and don't want to pat 10k to Google or Microsoft. We still ended up using the returned data in a Google Map.
如果你有一组相当大的地址来进行地理编码并且不想轻拍10k到谷歌或微软,这是一个很好的选择。我们最终仍然使用Google地图中的返回数据。
#16
0
you are asking about Geocoder. Google provide an API for this. so does another provider for this.
你问的是Geocoder。 Google为此提供了API。另一个提供者也是如此。
you can see the demo of implementation in My Current Location .net
您可以在My Current Location .net中看到实现的演示
#17
0
If you need a one off solution, you can try: https://addresstolatlong.com/
如果您需要一次性解决方案,可以尝试:https://addresstolatlong.com/
I've used it for a long time and it has worked pretty well for me.
我已经用了很长时间了,它对我来说效果很好。
#18
-1
The USC WebGIS Geocoder is free and offers several API's, or you can upload a database for online batch processing.
USC WebGIS Geocoder是免费的,提供多种API,或者您可以上传数据库进行在线批处理。
#1
46
Google has a geocoding API which seems to work pretty well for most of the locations that they have Google Maps data for.
谷歌有一个地理编码API,对于他们拥有谷歌地图数据的大多数地方来说,它似乎运行良好。
http://googlemapsapi.blogspot.com/2006/06/geocoding-at-last.html
They provide online geocoding (via JavaScript):
他们提供在线地理编码(通过JavaScript):
http://code.google.com/apis/maps/documentation/services.html#Geocoding
Or backend geocoding (via an HTTP request):
或后端地理编码(通过HTTP请求):
http://code.google.com/apis/maps/documentation/services.html#Geocoding_Direct
The data is usually the same used by Google Maps itself. (note that there are some exceptions to this, such as the UK or Israel, where the data is from a different source and of slightly reduced quality)
数据通常与Google地图本身使用的数据相同。 (请注意,有一些例外情况,例如英国或以色列,其数据来自不同的来源,质量略有降低)
#2
24
Nothing much new to add, but I have had a lot of real-world experience in GIS and geocoding from a previous job. Here is what I remember:
没有什么新东西可以添加,但我在以前的工作中有很多关于GIS和地理编码的实际经验。这是我记得的:
If it is a "every once in a while" need in your application, I would definitely recommend the Google or Yahoo Geocoding APIs, but be careful to read their licensing terms.
如果您的应用程序需要“每隔一段时间”,我肯定会推荐使用Google或Yahoo Geocoding API,但请务必阅读其许可条款。
I know that the Google Maps API in general is easy to license for even commercial web pages, but can't be used in a pay-to-access situation. In other words you can use it to advertise or provide a service that drives ad revenue, but you can't charge people to acess your site or even put it behind a password system.
我知道Google Maps API通常很容易获得商业网页的许可,但不能用于付费访问的情况。换句话说,您可以使用它来宣传或提供可以带来广告收入的服务,但您不能向人们收取费用来访问您的网站,甚至不能将其置于密码系统之后。
Despite these restrictions, they are both excellent choices because they frequently update their street databases. Most of the free backend tools and libraries use Census and TIGER road data that is updated infrequently, so you are less likely to successfully geocode addresses in rapidly growing areas or new subdivisions.
尽管存在这些限制,但它们都是很好的选择,因为它们经常更新街道数据库。大多数免费后端工具和库使用不经常更新的Census和TIGER道路数据,因此您不太可能在快速增长的区域或新的细分中成功地对地址进行地理编码。
Most of the services also restrict the number of geocoding queries you can make per day, so it's OK to look up addresses of, say, new customers who get added to your database, but if you run a batch job that feeds thousands of addresses from your database into the geocoder, you're going to get shutoff.
大多数服务还限制了您每天可以进行的地理编码查询的数量,因此可以查找添加到数据库中的新客户的地址,但是如果您运行的批处理作业可以从中提供数千个地址你的数据库进入地理编码器,你将被关闭。
I don't think this one has been mentioned yet, but ESRI has ArcWeb web services that include geocoding, although they aren't very cheap. Last time I used them it cost around 1.5cents per lookup, but you had to prepay a certain amount to get started. Again the major advantage is that the road data they use is kept up to date in a timely manner and you can use the data in commercial situations that Google doesn't allow. The ArcWeb service will also serve up high-resolution satellite and aerial photos a la Google Maps, again priced per request.
我不认为这个已被提及,但ESRI有ArcWeb网络服务,包括地理编码,虽然它们不是很便宜。上次我使用它们每次查询花费大约1.5美分,但你必须预付一定数量才能开始使用。同样,主要优势在于他们使用的道路数据能够及时更新,您可以在Google不允许的商业环境中使用这些数据。 ArcWeb服务还将提供Google地图上的高分辨率卫星和航空照片,并根据要求再次定价。
If you want to roll your own or have access to much more accurate data, you can purchase subscriptions to GIS data from companies like TeleAtlas, but that ain't cheap. You can buy only a state or county worth of data if your needs are extremely local. There are several tiers of data - GIS features only, GIS plus detailed streets, all that plus geocode data, all of that plus traffic flow/direction/speed limits for routing. Of course, the price goes up as you go up the tiers.
如果您想自己动手或可以访问更准确的数据,您可以从TeleAtlas等公司购买GIS数据订阅,但这并不便宜。如果您的需求非常本地化,您只能购买州或县的数据。有几层数据 - 仅GIS功能,GIS加上详细的街道,所有这些加上地理编码数据,所有这些都加上了路由的交通流量/方向/速度限制。当然,随着你上层,价格会上涨。
Finally, the Wikipedia article on Geocoding has some good information on the algorithms and techniques. Even if you aren't doing it in your own code, it's useful to know what kind of errors and accuracy you can expect from various kinds of data sources.
最后,*关于地理编码的文章提供了有关算法和技术的一些很好的信息。即使您没有在自己的代码中执行此操作,了解各种数据源可能出现的错误和准确性也很有用。
#3
11
Yahoo! Maps Web Services - Geocoding API accurately geocodes UK postcodes, unlike Google's API.
雅虎Maps Web Services - 与Google的API不同,地理编码API可准确地对英国邮政编码进行地理编码。
Unfortunately yahoo has deprecated this service, you could visit http://developer.yahoo.com/geo/placefinder/ for yahoo's service
不幸的是,雅虎已弃用此服务,您可以访问http://developer.yahoo.com/geo/placefinder/获取雅虎的服务
#4
10
试试这个:http://maps.googleapis.com/maps/api/geocode/json?address = 1600+Amphitheatre + Parkway,+ Mountain + View,+ CA&_sensor = false
more info here: http://code.google.com/apis/maps/documentation/geocoding/
有关详细信息,请访问:http://code.google.com/apis/maps/documentation/geocoding/
#5
5
When you convert an address or object to a lat/long it is called Geocoding.
将地址或对象转换为纬度/经度时,称为地理编码。
There are a lot geocoding solutions around. The solution right for your project will depend on the acceptability of the licensing terms of each geocoding solution. Both Microsoft Virtual Earth and Google Maps offer solutions which are free to use under a very restrictive licenses...
有很多地理编码解决方案。适合您项目的解决方案取决于每种地理编码解决方案的许可条款的可接受性。 Microsoft Virtual Earth和Google Maps都提供可在非常严格的许可下免费使用的解决方案......
http://code.google.com/apis/maps/documentation/services.html
#6
5
Having rolled my own solution for this before, I can whole heartedly recommend the Geo::Coder::US Perl module for this. Just download all the census data and use the included importer to create the Berkeley DB for your country and point the Perl script at it. Use the module's built in address parsing, and there you have it: An offline geocoding system!
我之前已经为此推出了自己的解决方案,我可以全心全意地推荐Geo :: Coder :: US Perl模块。只需下载所有人口普查数据并使用随附的导入程序为您所在的国家/地区创建Berkeley数据库,并将Perl脚本指向它。使用模块的内置地址解析,你就拥有它:一个离线地理编码系统!
#7
4
Try with this code, i work like this with addresses:
尝试使用此代码,我使用地址工作:
It is link in which with GET method you will send request and get lat and lng. http://maps.google.com/maps/api/geocode/json?address=YOUR ADDRES&sensor=false
这是与GET方法的链接,你将发送请求并获得lat和lng。 http://maps.google.com/maps/api/geocode/json?address=YOUR ADDRES&sensor = false
For exemple: http://maps.google.com/maps/api/geocode/json?address=W Main St, Bergenfield, NJ 07621&sensor=false
例如:http://maps.google.com/maps/api/geocode/json?address = W Main St,Bergenfield,NJ 07621&sensor = false
1. Create your GET method.
1.创建您的GET方法。
public static String GET(String url) throws Exception {//GET Method
String result = null;
InputStream inputStream = null;
try {
HttpClient httpclient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(url);
Log.v("ExecuteGET: ", httpGet.getRequestLine().toString());
HttpResponse httpResponse = httpclient.execute(httpGet);
inputStream = httpResponse.getEntity().getContent();
if (inputStream != null) {
result = convertInputStreamToString(inputStream);
Log.v("Result: ", "result\n" + result);
}
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
2. Create method for send request
2.创建发送请求的方法
@SuppressWarnings("deprecation")
public static String getLatLng(String accessToken) throws Exception{
String query=StaticString.gLobalGoogleUrl+"json?address="+URLEncoder.encode(accessToken)+"&sensor=false";
Log.v("GETGoogleGeocoder", query+"");
return GET(query);
}
gLobalGoogleUrl="http://maps.google.com/maps/api/geocode/"
3. Call method getLatLng
3.调用方法getLatLng
String result=getLatLng("W Main St, Bergenfield, NJ 07621");
4. Parse JSONObject
4.解析JSONObject
Now result is JSONObject with information about address and lan,lng. Parse JSONObject (result) with gson(). After that use lat,lng.
现在结果是JSONObject,其中包含有关地址和lan,lng的信息。使用gson()解析JSONObject(结果)。之后使用lat,lng。
If you have question about code , ask.
如果您对代码有疑问,请询问。
#8
2
You want a geocoding application. These are available either online or as an application backend.
您需要一个地理编码应用程序。这些可以在线获得,也可以作为应用程序后端使用。
-
Online applications:
- Google has a geocoding API
谷歌有一个地理编码API
-
Backend applications:
在线申请:Google拥有地理编码API
后端应用程序:GeoStan
#9
2
Maptsraction (http://www.mapstraction.com) lets you choose between any number of geocoding services. This could be helpful if you need to do large quantities, as I know Google has a limit to how many you can do a day.
Maptsraction(http://www.mapstraction.com)允许您在任意数量的地理编码服务之间进行选择。如果您需要大量购买,这可能会有所帮助,因为我知道Google每天可以执行的操作数量有限制。
#10
#11
2
You could also try the OpenStreetMap NameFinder (or the current Nominatim), which contains open source, wiki-like street data for (potentially) the entire world.
您还可以尝试使用OpenStreetMap NameFinder(或当前的Nominatim),它包含(可能)整个世界的开源,类似wiki的街道数据。
#12
1
you can use bing maps soap services, where you can reference reverse geocode service to find lat/long from address here is the link http://msdn.microsoft.com/en-us/library/cc980922.aspx
你可以使用bing maps soap服务,你可以在这里引用反向地理编码服务来查找lat / long来自这里的链接http://msdn.microsoft.com/en-us/library/cc980922.aspx
#13
#14
0
You can use Microsoft's MapPoint Web Services.
您可以使用Microsoft的MapPoint Web服务。
I created a blog entry on how to convert an address to a GeoCode (lat/long).
我创建了一个关于如何将地址转换为GeoCode(lat / long)的博客条目。
#15
0
Thought I would add one more to the list. Texas A&M has a pretty decently priced service here: http://geoservices.tamu.edu/Services/Geocode/
以为我会在列表中添加一个。 Texas A&M在这里提供价格相当不错的服务:http://geoservices.tamu.edu/Services/Geocode/
A good option if you have a pretty large set of addresses to geocode and don't want to pat 10k to Google or Microsoft. We still ended up using the returned data in a Google Map.
如果你有一组相当大的地址来进行地理编码并且不想轻拍10k到谷歌或微软,这是一个很好的选择。我们最终仍然使用Google地图中的返回数据。
#16
0
you are asking about Geocoder. Google provide an API for this. so does another provider for this.
你问的是Geocoder。 Google为此提供了API。另一个提供者也是如此。
you can see the demo of implementation in My Current Location .net
您可以在My Current Location .net中看到实现的演示
#17
0
If you need a one off solution, you can try: https://addresstolatlong.com/
如果您需要一次性解决方案,可以尝试:https://addresstolatlong.com/
I've used it for a long time and it has worked pretty well for me.
我已经用了很长时间了,它对我来说效果很好。
#18
-1
The USC WebGIS Geocoder is free and offers several API's, or you can upload a database for online batch processing.
USC WebGIS Geocoder是免费的,提供多种API,或者您可以上传数据库进行在线批处理。