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

Specifying flattening = 0 produces 'argument not numerical or out of range' exception #1191

JimBiardCics opened this issue Dec 5, 2018 · 2 comments


Copy link

@JimBiardCics JimBiardCics commented Dec 5, 2018

Specifying a flattening of zero was OK in proj 4.9.3. In proj 5.0.0 and above, it produces an error. I checked this using the Lambert Conformal Conic and Stereographic projections.

Here are two command line examples:

proj +proj=stere +ellps=WGS84 +f=0.0 +lat_0=90 +lat_ts=71 +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378470.0 +no_defs
proj +proj=lcc +ellps=sphere +f=0.0 +lon_0=-107.0 +lat_0=50.0 +lat_1=50.0 +lat_2=50.0 +x_0=5632642.22547 +y_0=4612545.65137 +a=6378470.0 +no_defs

The choice of ellipse doesn't matter. If you try these with 4.9.3, you get success and correct results. If you try them with 5.0.0 or better, you get the result:

projection initialization failure
cause: argument not numerical or out of range
program abnormally terminated

I also found that I get correct results on 5.0.0 and better if I specify a vanishingly small flattening, +f=1.0e-200 for example.

I've tried this on Mac OSX 10.13.6 and RedHat Enterprise Linux 7 using proj installations via conda from conda-forge.

kbevers added a commit to kbevers/PROJ that referenced this issue Dec 5, 2018
Copy link

@kbevers kbevers commented Dec 5, 2018

Fixed in #1192

For a workaround instead of specifying +a=6378470.0 +f=0.0 you can just do +R=6378470.0 to use a sphere instead of forcing it by tweaking ellipsoid parameters. Also, remove the +ellps=WGS84 it is ignored when +a, +f or +R is set.


Copy link

@JimBiardCics JimBiardCics commented Dec 5, 2018



kbevers added a commit to kbevers/PROJ that referenced this issue Dec 5, 2018
@kbevers kbevers closed this in #1192 Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants