Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom proj operation definitions when transforming between two CRSes #31106

Open
MichelRuijter opened this issue Aug 6, 2019 · 24 comments
Labels
Feature Request Projections/Transformations Related to coordinate reference systems or coordinate transformation

Comments

@MichelRuijter
Copy link

I am trying to define a custom CRS. I have tested this CRS in OSGEO and I am able to put this CRS in the adapted CRS screen. It works for the test coordinates. When I press "OK" Qgis replies that the CRS is not valid: See also attached screenshot
crsshot2

cct +proj=pipeline +step +proj=cart +ellps=WGS84 +step +proj=helmert +convention=coordinate_frame +x=194.245 +y=-154.53 +z=102.676 +rx=351.5046 +ry=-701.841 +rz=251.9889 +s=6.296557 +exact +step +proj=cart +inv +ellps=intl +step +proj=tmerc +units=m +lat_0=17.63621319 +lon_0=-63.23752013 +x_0=4714.87 +y_0=1967.19 +k_0=1.0

Describe the bug

How to Reproduce

QGIS and OS versions

Additional context

@MichelRuijter MichelRuijter added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Aug 6, 2019
@nyalldawson
Copy link
Collaborator

Can you confirm your PROJ library version number?

@nyalldawson nyalldawson added the Feedback Waiting on the submitter for answers label Aug 6, 2019
@MichelRuijter
Copy link
Author

MichelRuijter commented Aug 6, 2019 via email

@nyalldawson
Copy link
Collaborator

You'll need 3.8.1 and a build based off Proj 6.1 in order to use pipeline based CRSes.

@MichelRuijter
Copy link
Author

MichelRuijter commented Aug 6, 2019 via email

@MichelRuijter
Copy link
Author

MichelRuijter commented Aug 6, 2019 via email

@nyalldawson
Copy link
Collaborator

The windows builds aren't currently using it -- you need to do a custom build for now.

@MichelRuijter
Copy link
Author

MichelRuijter commented Aug 6, 2019 via email

@nyalldawson
Copy link
Collaborator

Windows builds are very tricky, and it's going to be made much trickier because you'd also need to build proj 6. I'd suggest waiting till the official builds upgrade, at which stage this will be supported. In the meantime, it's more or less impossible on Windows.

@jef-n
Copy link
Member

jef-n commented Aug 6, 2019 via email

@nyalldawson
Copy link
Collaborator

@jef-n

But as GRASS doesn't support PROJ 6 yet, so the upgrade didn't take place yet.

I saw this in another thread, but didn't understand it. PROJ 6 doesn't drop the deprecated proj 4 API, so it should be able to build just by defining the ACCEPT_USE_OF_DEPRECATED_PROJ_API_H macro

@MichelRuijter
Copy link
Author

MichelRuijter commented Aug 6, 2019 via email

@MichelRuijter
Copy link
Author

MichelRuijter commented Nov 19, 2019 via email

@nyalldawson
Copy link
Collaborator

@MichelRuijter is your build based on proj 6? You can check via the About dialog

@MichelRuijter
Copy link
Author

MichelRuijter commented Nov 19, 2019 via email

@roya0045
Copy link
Contributor

@MichelRuijter Update QGIS, it should come with proj6.

@MichelRuijter
Copy link
Author

MichelRuijter commented Nov 19, 2019 via email

@rouault
Copy link
Contributor

rouault commented Nov 19, 2019

I tried within OSGEO 4 the following string:

This is a PROJ coordinate operation / pipeline string, not a PROJ CRS string, which is what QGIS / GDAL expects. In your use case, you could try +proj=tmerc +units=m +lat_0=17.63621319 +lon_0=-63.23752013 +x_0=4714.87 +y_0=1967.19 +k_0=1.0 +ellps=intl +towgs84=194.245,-154.53,102.676 ,-351.5046,701.841,-251.9889,6.296557 (note the negated signs of the rotation terms to pass from coordinate_frame convention to the implied position_vector by +towgs84)

@MichelRuijter
Copy link
Author

MichelRuijter commented Nov 20, 2019 via email

@rouault
Copy link
Contributor

rouault commented Nov 20, 2019

Proj6 should have the option to include more complex coordinate transformations including large rotations.

It does. But not in the CRS definition. Actually any Helmert-based transformation has nothing to do with the CRS definition, but is related how to the CRS transforms to another one. I'm not sure if QGIS has currently an option to define a custom PROJ pipeline between 2 CRS but I'm not sure. There is a Datum preference tab in Projects/Settings or Preferences/Options where you can select a datum transformation, but I couldn't find a way to override to add a PROJ pipeline.
Another possibility might be to tune the proj.db to define your own transformation, but that's a bit more involved.

@MichelRuijter
Copy link
Author

MichelRuijter commented Nov 20, 2019 via email

@MichelRuijter
Copy link
Author

MichelRuijter commented Nov 21, 2019 via email

@nyalldawson
Copy link
Collaborator

@MichelRuijter

Sorry, I missed that your definition was actually defining an operation and not a CRS in my earlier response.

This isn't yet possible to do via the QGIS ui (but the required backend capabilities should all be present). What we'd need to do is extent the transformation selection dialog (the dialog which allows you to pick from known transformation pathways between a source and destination crs pair) to also allow users to enter a custom proj operation string, alongside the existing choice of known operations.

This would then allow QGIS to use your custom operation when transforming between the source/destination CRSes.

There's a bit of development work required to do this, mainly just revamping the transformation selection dialog to allow this kind of manual entry. Let me know if you'd like to sponsor this change!

@nyalldawson nyalldawson added Feature Request and removed Bug Either a bug report, or a bug fix. Let's hope for the latter! labels Nov 25, 2019
@nyalldawson nyalldawson changed the title CRS proj definition not valid Allow custom proj operation definitions when transforming between two CRSes Nov 25, 2019
@nyalldawson nyalldawson removed the Feedback Waiting on the submitter for answers label Nov 25, 2019
@nyalldawson nyalldawson added the Projections/Transformations Related to coordinate reference systems or coordinate transformation label Dec 13, 2019
@Ognian
Copy link

Ognian commented Apr 5, 2024

Having exact the same problem, I'm wondering if there is another way to do it, since it is quite a bit of time passed since this was opened...

@otofoto
Copy link

otofoto commented Jun 7, 2024

@Ognian
If you would like to test new pipeline, you must edit proj.db, add the new transform and a new usage record for it. Only after that you select my custom transform there. However, this approach is a bit too complicated, as described above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Projections/Transformations Related to coordinate reference systems or coordinate transformation
Projects
None yet
Development

No branches or pull requests

7 participants