<br>Hi All,<br><br>I am brand new to QGIS (having got here from my work with OpenStreetMap) so apologies if I am posting this in the wrong place. What I am trying to do is adapt the fTools plugin so that it can save to any ogr verctor file format. The reason behind this is that I found the ESRI shapefile format to be restrictive (e.g. attribute values are limited to 254 chars - 80 in QGIS??).<br>
<br>So far <span class="il">Carson has kindly pointed me in the direction of the QGIS repo and I have exposed the other ogr formats in the save file dialog. This is where I get stuck. I can call QgsEncodingFileDialog().selectedNameFilter() to get the file name format however this is not compatible with the way QgsVectorFileWriter() works. The file writer requires the "driver name" as a format (e.g. ESRI Shapefile) whereas </span><span class="il">selectedNameFilter() returns the hard coded name in the save dialogues drop down box (e.g. ESRI Shapefiles [OGR] (*.shp *.SHP) ). <br>
<br>Q: Is there an easy way to get just the driver name?<br><br>- - - - - - - - - - - - - - - <br><br>FYI I have looked at gdal tools. They set up a dictionary to be able to lookup any "LONGNAME" and return the driver name (SHORTNAME). The longnames are hard coded in the plugin and represent the QGIS save dialogues drop down format names (with the [OGR] and bracketed file extensions cut). The shortnames are the driver names from ogr. This code can be seen here:<br>
<br><a href="http://hub.qgis.org/projects/quantum-gis/repository/revisions/master/entry/python/plugins/GdalTools/tools/GdalTools_utils.py#L562">http://hub.qgis.org/projects/quantum-gis/repository/revisions/master/entry/python/plugins/GdalTools/tools/GdalTools_utils.py#L562</a><br>
<br>Although this should work, it would seem odd to have this hard coding in every plugin that wants to write to any ogr format!!<br><br>Any ideas appreciated<br><br>Regards,<br>Rob<br><br><br></span>