Python: 百度API实现火星坐标转百度坐标
来源:互联网 发布:宁波数据分析招聘 编辑:程序博客网 时间:2024/05/30 07:14
以下是我写的调用百度API将火星坐标转换成百度坐标的python代码:
# -*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
from urlparse import urlparse
from urlparse import urlunparse
from urlparse import urljoin
import urllib
import os
api="http://api.map.baidu.com/geoconv/v1/?coords="
f=open("coortest_20.txt")
tof=open("liru.txt",'w')
while True:
line=f.readline().strip('\n')
if line:
try:
jwlist=line.split(',')
jingdu=str(jwlist[1])
weidu=str(jwlist[0])
url=api+jingdu+","+weidu+"&from=1&to=5&ak=秘钥"
res=urllib.urlopen(url)
buffer=res.read()
split_buffer=buffer.split('"x":')
t=split_buffer[1]
t_split=t.split(',"y":')
x=t_split[0]
y_split=t_split[1].split('}]}')
y=y_split[0]
print x,y
#print buffer[]
tof.write(x)
tof.write(y)
tof.write('\n')
except:
tof.write("ERROR")
tof.write('\n')
else:
break
tof.close()
print "finished!"
0 0
- Python: 百度API实现火星坐标转百度坐标
- 百度坐标转火星坐标
- 火星坐标转百度坐标
- 火星坐标转百度坐标
- 地球坐标,火星坐标,百度坐标转换的php实现
- iOS地球坐标,火星坐标,百度坐标互转
- JSP 火星坐标及GPS坐标 转百度坐标
- iOS地球坐标,火星坐标,百度坐标互转
- iOS地球坐标,火星坐标,百度坐标互转
- JSP 火星坐标及GPS坐标 转百度坐标
- iOS地球坐标,火星坐标,百度坐标互转
- 地球坐标,火星坐标,百度坐标转换
- 地球坐标,火星坐标,百度坐标转换
- 地球坐标,火星坐标,百度坐标转换
- 地球坐标,火星坐标,百度坐标转换
- 地球坐标,火星坐标,百度坐标转换
- 地球坐标,火星坐标,百度坐标转换
- WGS84、Web墨卡托、火星坐标、百度坐标互转
- C语言入门-第二周:作业01
- NOI2.6基本算法之动态规划 踩方格 分析----标志物的作用
- was mutated while being enumerated数组遍历时被修改
- ubuntu 16.04搭建LAMP
- 【记录】 Android 双卡手机获取IMEI等
- Python: 百度API实现火星坐标转百度坐标
- 软键盘切换与隐藏
- JS按位非(~)运算符与~~运算符的理解分析
- MySQL(五)视图的操作
- 非常有用的git命令
- window 命令行查看、结束进程命令
- QPropertyAnimation渐隐动画
- touch 命令
- The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml o