Using gridfiles (*.gsb) in QGIS

To add a new transformation you need to copy the .gsb file into the appropriate folder. For example "C:\osgeo4w\share\proj". In other QGIS installations it is within the Program folder, but always in the same subfolder (or search for .gsb files in the QGIS folder).

You then need to tell qgis to use the new transformation. Therefore you need to add a value in the srs.db of QGIS (C:\OSGeo4W\apps\qgis\resources\srs.db or equivalent). You need to open the SQLite file with DB Browser for SQLite for example. QGIS itself does not work with this SQLite file as it handles a column the wrong way where you can´t enter text but only numbers and you need to add the filename of the .gsb.

You open the table tbl_datum_transform and add a new line or duplicate the existing one with source=4314 and target=4258 (screenshot 1).

Afterwards you are able to select this transformation in QGIS (screenshot 2).

enter image description here

enter image description here


Since within our IT environment I have no permission to install tools like DB Browser fro SQLite, I tried reproducing the whole with QGIS DB Manager (QGIS 2 + 3) and succeeded!

First I create a new Spatialite connection to the aforementioned srs.db (connecting fails, because it of course has no spatialite extension). Then selecting this connection in QGIS DB Manager and firing this SQL statement works:

INSERT INTO tbl_datum_transform VALUES (99999, 100099, 4314, 4258, 9615, 'kanu_ntv2_mittelfranken.gsb', NULL, NULL, NULL, NULL, NULL, NULL, 'Für ALKIS Bayern, amtliche Gitterdatei des LDBV', 'Für Genauigkeitsanforderungen im cm Bereich', 1, 0, NULL)

Note that QGIS does not need a restart for the changes to take effect.

enter image description here

enter image description here