关键词不能为空

当前您在: 主页 > 英语 >

根据地名获取经纬度

作者:高考题库网
来源:https://www.bjmy2z.cn/gaokao
2021-02-09 23:39
tags:

-

2021年2月9日发(作者:草头王)



根据地名获取经纬度



1.



根据


goole api


得到经纬度:



String


strUrl=














URL url;





InputStream in = null;





String str =





String lnglat =





try {






url = new URL((strUrl, strCurrent));






URLConnection uc = nnection();






in = utStream();











/*Object obj = tent();






InputStream in = (InputStream) obj;*/






byte[] tt = new byte[ble()];






int z;






while ((z = (tt, 0, )) != -1) {







str = new String(tt,







//n(str);






}






();





} catch (MalformedURLException e) {






tackTrace();





} catch(SocketException e) {






lnglat =








n((i) +







} catch (IOException e) {






tackTrace();





}









if(str !=






lnglat = getString(str);






n((i) +







}









try {






(1000);





} catch (InterruptedException e) {






tackTrace();





}





public static String getLngAndLat(InputStream instream) {




DocumentBuilderFactory dbf = tance();




DocumentBuilder db = null;







try {





db = umentBuilder();




} catch (ParserConfigurationException e) {





tackTrace();




}







Document doc = null;




try {





doc = (instream);




} catch (SAXException e) {





tackTrace();




} catch (IOException e) {





tackTrace();




}







Element root = umentElement();




NodeList points = mentsByTagName(




String lnglat =




for(int i=0;i





Element point = (Element)(i);





lnglat = ribute(




}




return lnglat;



}



public static String


getString


(String xmlString) {




int a = f(




int b = f(




int c = f(




int d = f(




String lat = ing(a+5, b);




String lng = ing(c + 5, d);




return lng +





}




2.



根据 “百度


API


”得到地名的经纬度:



Html


代码是:







-


-


-


-


-


-


-


-



本文更新与2021-02-09 23:39,由作者提供,不代表本网站立场,转载请注明出处:https://www.bjmy2z.cn/gaokao/624960.html

根据地名获取经纬度的相关文章