Is it possible in the Python script to get the name of the OGR driver (for example, "Esri Shapefile" or "MapInfo File") for the QGIS vector layer?
QGIS 2.18


You can try the following :

layer = QgsMapLayerRegistry.instance().mapLayersByName("my_layer_name")
driverName= layer[0].dataProvider().storageType()

Found in the API documentation : QGIS API

  • I think this is it. Difficulties of translation ... I was looking for a similar DriverName. Thank. – Dmitry Apr 18 '19 at 8:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.