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

Feedback on sterea / gauss projection implementation. #12

Open
SamMousa opened this issue Apr 4, 2016 · 1 comment
Open

Feedback on sterea / gauss projection implementation. #12

SamMousa opened this issue Apr 4, 2016 · 1 comment

Comments

@SamMousa
Copy link
Contributor

SamMousa commented Apr 4, 2016

I have implemented the sterea projection:
https://github.com/SamMousa/Proj4/blob/master/src/Projection/Sterea.php

However I'm not getting correct results when comparing to proj4 (the C variant).

Could you check if you see any obvious errors?

@SamMousa
Copy link
Contributor Author

SamMousa commented Apr 5, 2016

Okay I've got it working (took the implementations they used in proj4php) and am getting close to the same result as cs2cs:

Mine: [6.6028105991312, 53.294205897322]
Cs2cs: [6.60652472415, 53.2969942548]

This probably has to do with the fact that after doing the inverse sterea projection I still need to convert to the proper ellipsoid (my source EPSG:28992 uses bessel).

Note that my implementation doesn't "integrate" well now, since I've chosen to do the projections as simple classes. This means that they take all the parameters they need in the constructor; for Gauss for example you need the eccentricity squared ($es) of the ellipsoid, so you must pass that in. For Sterea, which extends Gauss the length of the semi-axis A is required, so to construct Sterea you must pass in both.

This gets pretty verbose but guarantees clear dependencies. For the projection the datum for example is not used at all, so passing in a coordinate (which has datum and projection information included) is a bit overkill.

Of course when we validate this approach it then becomes easy to build 1 or more helper classes that allow functionality similar to commandline tools like cs2cs, just passing in data in 1 format and getting it out in another.

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

No branches or pull requests

1 participant