Bug report #18022
Custom projections/transformations using a PROJ init-file fails.
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Windows 10. Mac OS X.||Easy fix?:||Yes|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||25918|
QGIS can't create custom projections that uses PROJ.4 init-files. As seen on the attached screenshot, when I enter the PROJ.4 parameters - in this case “+init=C:\dev\NordicTransformations\resources\DK:UTM32N” - the test works fine but when I try to save it, I am presented with the message "The proj4 definition of 'Init-test' is not valid". Since the test works the problem is not that the file can’t be found or that the definition is invalid - it is something else. I suspect there's some faulty logic at play here since the transformation obviously works. It has been suggested that the problem might be that there is not an inverse transformation available, which is not the case either.
I experience the same behavior in both QGIS2 and QGIS3.
The reason I want to define custom CRS's is that I only want to maintain the projections/transformations that I need in one place instead of many. Also, until QGIS adopts the new features in the comming version of PROJ, this is the only viable way to access the advanced transformations that the new PROJ version allows.
I have marked this as an easy fix. Having looked at the affected code months ago, it seems to be a rather localized problem. It is my best guess that this can be fixed quickly by someone familiar with the code.
#1 Updated by Kristian Evers about 2 years ago
- File custom-init added
Reproducing the problem is simple. Save the attached file "custom-init" some where on the system. Go to the custom CRS dialog and add a new one. Give it a name and fill out the parameters text box with something like "+init=C:\temp\custom-init:test" (obviously adjusting the path to where the file is located). Enter the coordinates 55, 12 (north, east). Press calcuate, the destination coordinates should read "7326837.72 1335833.89", which is similar to the output from the same transformation with proj:
λ echo 12 55 | proj +init=C:\temp\custom-init:test
When okay is pressed the error message is displayed.