根据gps经纬度查询地点

String lat = "24.26979";
        String log = "102.22431";
        String urll = "http://gc.ditu.aliyun.com/regeocoding?l=" + lat + "," + log + "&type=010";
        URL url = new URL(urll);
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setDoOutput(true);
        conn.setRequestMethod("POST");
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
        String s = null;
        StringBuilder ss =  new StringBuilder();
        while ((s = bufferedReader.readLine()) != null) {
            ss.append(s).append("--");
        }
        bufferedReader.close();
        System.out.println(ss.toString());

这里用的阿里云的

你可能感兴趣的:(根据gps经纬度查询地点)