本想将代码文件缀在上一篇的后面,但因为没这个功能,所以新开一篇,放置代码,其中有些是废的,有些是摸索中写的,没有写注释,不知道以后自己能不能看懂。。。。。。哈哈哈哈哈哈哈
import json
import numpy
def openShpJson(fileName):
with open(fileName,'r',encoding='utf-8') as f:
data = json.load(f)
p = data['features'][0]['geometry']['rings'][0]
pstr = json.dumps(p, indent=4)
#pstr = json.dumps(data, indent=4)
#print(pstr)
return p
def openJson(fileName):
with open(fileName,'r',encoding='utf-8') as f:
data = json.load(f)
p = [[float(x) for x in inner] for inner in data]
pstr = json.dumps(p, indent=4)
#pstr = json.dumps(data, indent=4)
print(pstr)
return p
def czml(fileName):
with open(fileName,'r',encoding='utf-8') as f:
data = json.load