OSG 里面写的GDAL,傻傻分不清楚,的资料好难找,顺便记录一下。
from osgeo import ogr json_driver = ogr.GetDriverByName('GeoJSON') json_fn = r'C:\Users\h\Documents\Tencent Files\873054267\FileRecv\move27.json' json_ds = json_driver.Open(json_fn) cs=json_ds.GetLayerByIndex(0) #extent=cs.GetExtent() for row in cs: k=row.geometry() print(k.GetEnvelope())