# Custom Projections

# Custom projections in QGIS

It is common to have multiple layers with different coordinate reference systems in one QGIS project. To display these layers accurately, it is necessary to define the transformation between the coordinate reference systems.

QGIS on Windows and macOS comes with preinstalled projections and transformations that are handled by PROJ (opens new window), including a whole lot of grid shift files for accurate horizontal and vertical coordinate transformations. However, some specific projections that are not included in PROJ data (opens new window) may require you to install additional grid shift files manually. If this is the case, QGIS will show you a warning and will allow you to install the grid shift file from a folder.

QGIS install transformation grid shift

TIP

Grid shift files are usually provided by national geodetic authorities. Common formats are Geodetic TIFF grids (.tiff) and National Transformation version 2 (.gsb) files.
PROJ data (opens new window) gathers Geodetic TIFF grids from various sources, so you might be able to download your grid shift file from there.

You only need to do this setup once. After you install the grid files, they are automatically used by QGIS whenever needed.

WARNING

If you want to share your project with someone else, they also need to install the grid shift files in their QGIS in order to display the data correctly.

# Further reading about projections and transformations

This extended article contains more information about map projections, coordinate reference systems and transformations.

If you want to learn more about this topic, we recommend to go through the QGIS Documentation QGIS online documentation (opens new window) or PROJ documentation (opens new window).

Projections issues are one of the common causes of misplacement of your field data as mentioned in our blog Why are my survey points shifted? (opens new window).

# Custom projections in Mergin Maps mobile app

If you had to install grid shift files in QGIS in order to display your layers correctly, it is also necessary to provide the same grid shift files to Mergin Maps mobile app.

Mergin Maps mobile app supports grid shift files formats:
  • National Transformation version 2 (.gsb)
  • Geodetic TIFF grids (.tiff)

When the app starts, it searches for proj folders in all available projects on the disk. The grid shift files found in these folders can be then used in all projects.

# Adding grid shift files to Mergin Maps mobile app

since QGIS plugin 2022.6

It couldn't be easier! When creating a new Mergin Maps project by packaging current QGIS project or using current QGIS project as is, Mergin Maps QGIS plugin will copy all required datum shift grids to the appropriate project folder.

All you need to do is:

  1. Define the coordinate systems, projections and transformations in your Mergin Maps project in QGIS as you need.

  2. Synchronise the project using the QGIS plugin.
    If a shift grid file is missing, you will get a warning containing a link to fix the issue.

  3. Download the project with the grid shift files to Mergin Maps mobile app.
    When the project is downloaded to the app for the first time, you will get a PROJ Error that will prompt you to restart the app to load the grid shift files. The error message should not appear after the restart of the app.
    Mergin Maps mobile app transformation shift grid error

# Adding grid shift files manually

If you want to add grid shift files to the mobile app manually:

  1. Create a folder called proj in your project folder
    proj folder in project folder

  2. Copy the grid shift file to the proj folder
    Grid shift file in proj folder

    TIP

    Grid shift files installed in QGIS on your computer can be found in these locations:

    • Windows users: C:\Users\USER\AppData\Roaming\QGIS\QGIS3\profiles\default\proj (USER is your username)
    • macOS users: ~/Library/Application\Support/QGIS/QGIS3/profiles/default/proj
    • Linux users: ~/.local/share/QGIS/QGIS3/profiles/default/proj
  3. Synchronise the project using the QGIS plugin

  4. Download the project with the grid shift files to Mergin Maps mobile app.
    When the project is downloaded to the app for the first time, you will get a PROJ Error that will prompt you to restart the app to load the grid shift files. The error message should not appear after the restart of the app.
    Mergin Maps mobile app transformation shift grid error