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

Add +proj=topocentric geocentric->topocentric conversion (fixes #500) #2444

Merged
merged 1 commit into from Dec 2, 2020

Conversation

rouault
Copy link
Member

@rouault rouault commented Nov 22, 2020

No description provided.

Copy link
Member

@kbevers kbevers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me. There's few minor details in the documentation that would be nice to sort out otherwise I have no problems with merging this.

Comment on lines +44 to +46
When conversion between geographic and topocentric coordinates is desired, the
topocentric conversion must be preceded by the :ref:`cart` conversion to
perform the initial geographic to geocentric coordinates conversion.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I most often see ENU-coordinates exressed in degrees (e.g. the model input for +proj=deformation which I believe to be similar to this) would that then be a matter of doing a pipeline like +proj=pipeline +step ... +step +proj=topocentric ... +step +proj=cart +inv? If that is the case, I think an example for that would be useful too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum, from my testing, it doesn't seem that using +proj=cart +inv would give the expected result. In defmodel_impl.hpp, there's the function

inline void DeltaEastingNorthingToLongLat(double cosphi, double de, double dn,
                                          double a, double b, double es,
                                          double &dlam, double &dphi) {
    const double oneMinuX = es * (1 - cosphi * cosphi);
    const double X = 1 - oneMinuX;
    const double sqrtX = sqrt(X);
    dlam = de * sqrtX / (a * cosphi);
    dphi = dn * a * sqrtX * X / (b * b);
}

and if doing for example "echo 4.99 55.1 73 | src/cct -d 3 +proj=pipeline +step +proj=affine +step +proj=cart +ellps=WGS84 +step +proj=topocentric +ellps=WGS84 +lon_0=5 +lat_0=55 +h_0=200", and injecting the resulting de, dn into it, it gives the expected dlon ~= -0.001 and dlat ~= 0.1. Whereas using +proj=cart +inv gives completely different and wrong results.

I'd suspect DeltaEastingNorthingToLongLat() to be an approximation only valid for small deltas. Maybe @ccrook can give some hints ?

@rouault rouault force-pushed the topocentric branch 2 times, most recently from 0d45041 to 7706979 Compare November 23, 2020 15:02
@rouault rouault merged commit b7fb045 into OSGeo:master Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants