Skip to main content
2 of 4
naming
Vince
  • 20.3k
  • 16
  • 48
  • 65

How to use ogrinfo in a Python script

I've been using OGR/GDAL in its command window to obtain information regarding a vector file with this command

ogrinfo -so -al d:/vector_file.shp

I'm now trying to incorporate this in a Python script but I'm unsure how to do it?

I tried looking in this documentation https://pcjericks.github.io/py-gdalogr-cookbook/vector_layers.html#get-shapefile-feature-count

but couldn't find any examples with ogrinfo or how to explicitly state the arguments