python

tech2022-07-13  195

Esri文件地理数据库 gdb

查看该库涉及的图层

import ospybook as pb import sys from osgeo import ogr fn = r'D:\WorkSpace\Jupyter notebook\data\gsgl\高速.gdb' pb.print_layers(fn)

打开指定名的图层

import sys from osgeo import ogr fn = r'D:\WorkSpace\Jupyter notebook\data\gsgl\高速.gdb' ds = ogr.Open(fn,0) if ds is None: sys.exit('Could not open {0}.'.format(fn)) lyr = ds.GetLayer('LX_G_ALL') print(lyr.GetSpatialRef())

最新回复(0)