[PROJ] How to do Helmert transformation with +exact option in QGIS?

Nyall Dawson nyall.dawson at gmail.com
Tue Feb 9 15:53:58 PST 2021


On Wed, 10 Feb 2021 at 09:46, Lesparre, Jochem
<Jochem.Lesparre at kadaster.nl> wrote:
>
> Nyall wrote:
> > Actually since 3.10 we've also supported direct WKT(2) definitions of custom CRS, and the GUI strongly pushes users towards defining custom projections using WKT over PROJ now :)
>
> Yes, I noticed. It's good to have that option too. Although, I do not find it so easy to define a CRS like that, as WKT is not very compact and it is really hard for a human to get the parenthesis right. But, I willing to accept that if there is a way to refer to the exact Helmert transformation with WKT! Is this possible?
>
> Kristian wrote:
> > If it is super important to you, you may be able to hack the proj.db that QGIS opens and add your own custom CRS and transformations. Not sure I would recommend that though :-)
>
> I have no objection against editing the proj.db myself, however the CRS should be usable by other people too. My idea was to provide a simple instruction on how to add a custom CRS in QGIS, until I would get this CRS added to the EPSG registry. But I might need to get the exact Helmert method added to EPSG first.

It's pretty straightforward to do via python:

crs = QgsCoordinateReferenceSystem.fromWkt( ' ... ' )
crs.saveAsUserCrs("My first projection",
nativeFormat=QgsCoordinateReferenceSystem.FormatWkt)

or if using a proj string

crs = QgsCoordinateReferenceSystem.fromProj( ... )
crs.saveAsUserCrs("My first projection",
nativeFormat=QgsCoordinateReferenceSystem.FormatProj)

That's the easiest approach I can think of for users. At its simplest
you could save this as a .py file and get users to drag and drop it
over their QGIS. (Or deploy in an organisation's startup script, or
make a tiny plugin which adds this projection for users, or ... !)

Nyal



>
> Kristian wrote:
> > Any chance I might be able to define my own PROJ transformation pipeline between a layer CRS and the project CRS then? That’d be handy from time to time and would probably also fix Jochems problem.
>
> I'm not sure how this would work. I start to think that the best available solution is to create a hgridshift file. Unfortunately, that would give me the same horizontal coordinates at any height. Due to the large rotations of the CRS and a volcano in the area of interest, this would cause a horizontal error of 0.1 metre between points at sea level and the highest point. Unless, I create a really dense hgridshift file to let it give the right horizontal results at DTM height. But that would be bit complex.
>
> Regards, Jochem
>
>
>
> Disclaimer:
> De inhoud van dit bericht is uitsluitend bestemd voor geadresseerde.
> Gebruik van de inhoud van dit bericht door anderen zonder toestemming van het Kadaster
> is onrechtmatig. Mocht dit bericht ten onrechte bij u terecht komen, dan verzoeken wij u
> dit direct te melden aan de verzender en het bericht te vernietigen.
> Aan de inhoud van dit bericht kunnen geen rechten worden ontleend.
>
> Disclaimer:
> The content of this message is meant to be received by the addressee only.
> Use of the content of this message by anyone other than the addressee without the consent
> of the Kadaster is unlawful. If you have received this message, but are not the addressee,
> please contact the sender immediately and destroy the message.
> No rights can be derived from the content of this message.


More information about the PROJ mailing list