from osgeo import ogr ds = ogr.Open("states.shp",0) layer = ds.GetLayer() capabilities = [ ogr.OLCRandomRead, ogr.OLCSequentialWrite, ogr.OLCRandomWrite, ogr.OLCFastSpatialFilter, ogr.OLCFastFeatureCount, ogr.OLCFastGetExtent, ogr.OLCCreateField, ogr.OLCDeleteField, ogr.OLCReorderFields, ogr.OLCAlterFieldDefn, ogr.OLCTransactions, ogr.OLCDeleteFeature, ogr.OLCFastSetNextByIndex, ogr.OLCStringsAsUTF8, ogr.OLCIgnoreFields ] print("Layer Capabilities:") for cap in capabilities: print(" %s = %s" % (cap, layer.TestCapability(cap)))
获得一个层的能力
关注公众号
获取免费资源
Copyright © Since 2014.
开源地理空间基金会中文分会
吉ICP备05002032号
Powered by TorCMS