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

src/asf_meta/distortions.c relies on a non-public part of the PROJ.4 API #128

Open
ninneman opened this issue Jun 15, 2013 · 3 comments
Open

Comments

@ninneman
Copy link
Contributor

src/asf_meta/distortions.c relies on parts of the PROJ.4 API that are considered internal, and so this code is fragile, subject to breakage when PROJ.4 changes.

  1. The projects.h header is private, and shouldn't be included.
  2. The function map_distortions() at one point attempts to directly access the members of a projPJ structure. This is considered bad practice by the PROJ.4 team, since the members are internal and subject to change.

Attempting to fix problem 1 causes compilation errors related to problem 2.

@rudigens
Copy link
Contributor

Did not see any other way to get access to the pre-calculated map distortions. If you find any other way to get those, please let me know and I will revise the code.

@ninneman
Copy link
Contributor Author

ninneman commented Dec 3, 2014

It looks like the proper way to set the internals of a projPJ type is to do it with the string passed to pj_init_plus(). See http://trac.osgeo.org/proj/wiki/GenParms.

That handles setting the internals. I'm still looking at how to access them.

@rudigens
Copy link
Contributor

rudigens commented Dec 3, 2014

There is a reason why I coded it up that way in the first place. Really
could not find any other way of doing it.

I would not worrying too much about somebody changing proj4. If you just
look at the way string are used to pass along parameters, ... . Some more
people have contemplated ripping all that stuff out of there and replace it
with something proper. Yet, nobody really dared to touch it. As Kirk would
say "Don't change code that is working perfectly fine."

Best regards,
Rudi

Rudi Gens
Alaska Satellite Facility, Geophysical Institute, University of Alaska
Fairbanks
903 Koyukuk Dr., P.O. Box 757320, Fairbanks, AK 99775-7320, USA
Phone: 1-907-4747621 Fax: 1-907-4746441
Email: rgens@alaska.edu URL: http://www.gi.alaska.edu/~rgens

On Wed, Dec 3, 2014 at 10:45 AM, ninneman notifications@github.com wrote:

It looks like the proper way to set the internals of a projPJ type is to
do it with the string passed to pj_init_plus(). See
http://trac.osgeo.org/proj/wiki/GenParms.

That handles setting the internals. I'm still looking at how to access
them.


Reply to this email directly or view it on GitHub
#128 (comment)
.

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

2 participants