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
Pipeline with +towgs84 doesn't work as expected #871
Comments
Can be reproduced with cct
Interestingly it seems the issue is specific to a 7-term towgs84 transform. With just 3-terms it is OK
|
Possibly related to this question on the mailing list. Answer by @busstoptaktik. It would be nice to find a way for this to work. I know that Thomas struggled with it quite a lot so it might not be easy to find a solution. I Realise that this probably wont't solve your problem right now but try the following. At least for the sake of debugging this:
|
Or maybe it's just a precision issue ?
and
which is equivalent to
I see that in the old pj_transform.c there's a pj_compare_datums() that avoids any geodetic <--> geocentric transformation if the ellipsoids and 7-params of the source and targets are the same. Reading cct help, I see roundtrip accuracy can be tested with this syntax (I've a hard time to understand it... the +proj=longlat without a preceding +step, and the ending +step +step +inv ?)
|
That's very likely, yes. I haven't had time to look into this myself yet.
Yeah, that's a bizarro use of global pipeline parameters. It is the same mechanism as
where The global pipeline parameters are defined as everything between |
Precision issue confirmed. The patch below fixes the problem, but at the expense of slower computation:
It might be possible to find a clever way to detect when the |
Some further investigation:
Conclusion: The patch in the previous comment should just be applied. There is no real downside to it, apart for a slightly more expensive PJ-setup. |
Great finding ! I'm wondering if the helmert transformation shouldn't default to 'exact' ? And have rather an 'approximate' setting if really needed ? |
It started out that way, but there's a few things to consider. One is when your start doing transformations of coordinates where the time component is different for each coordinate. When the time component is different to the previous coordinate the transformation matrix is recalculated. This very quickly gets very expensive. Another is that the approximate version is almost universally used. I haven't seen a real world use of it - even in super accurate geodetic applications. A third reason is that this is what PROJ has been doing with So I decided on the approximate as the default since it offers the fastest calculation and is what most (if not all) users would intuitively expect. |
Trying to port GDAL to use new API, I'm doing some unexpected results when doing supposedly no-op transformations involving towgs84
The output of the following code
is
Whereas the second line corresponding to the output should be identical to the first one
Doing the same using the proj_api.h with pj_transform() results in the expected result
The text was updated successfully, but these errors were encountered: