[Qgis-user] Model Designer - GDAL - Vector Conversion

Richard Duivenvoorde rdmailings at duif.net
Wed Mar 9 03:42:41 PST 2022


On 3/9/22 00:41, Johanna Botman via Qgis-user wrote:
> I am trying to use the Model Designer to automate the creation of Tab files from SQL Database Tables.
> 
> I am using GDAL – Vector Conversion – Convert format
> 
> The resulting Tab file is missing the Primary Key field.
> 
> If use that same algorithm to export to a Geopackage, the PK is there.
> 
> I know that I can right click the SQL Table and select Export. That Tab file contains the PK. I need to export 30 tables so am looking for some automation.
> 
> Why does the algorithm produce a table without the key field?

Hi Johanna,

Are you using 'Convert Format' which 'uses' ogr2ogr to convert?

Because in that dialog you can add 'Advanced parameters' and if I am right you can add specific driver params there.

The 'tab'-driver though:
https://gdal.org/drivers/vector/mitab.html
does not mention a primary key...

I also found:
https://github.com/OSGeo/gdal/issues/2651
which mentions a  -preserve_fid (advanced param)
see https://gdal.org/programs/ogr2ogr.html

So you can actually add some specific gdal params there...?

HTH, Regards,

Richard Duivenvoorde





More information about the Qgis-user mailing list