使用的工具是GEODOING API,参考http://developer.baidu.com/map/webservice-geocoding.htm
首先要申请百度密钥,http://lbsyun.baidu.com/apiconsole/key?application=key
得到密钥后,即可开发,用java写的例子如下
String url = "http://api.map.baidu.com/geocoder/v2/?address=深圳市港湾大道&output=json&ak=youraccesskey";
URL myURL = null;
URLConnection httpsConn = null;
// 进行转码
try {
myURL = new URL(url);
} catch (MalformedURLException e) {
e.printStackTrace();
}
try {
httpsConn = (URLConnection) myURL.openConnection();
if (httpsConn != null) {
InputStreamReader insr = new InputStreamReader(
httpsConn.getInputStream(), "UTF-8");
BufferedReader br = new BufferedReader(insr);
String data = null;
if ((data = br.readLine()