Closed corinnebosley closed 7 years ago
Please demonstrate this issue with only the cs2cs
command and not with cartopy or numpy or anything else that can potentially confound the issue.
Good coords:
cs2cs +over +proj=latlon +ellps=WGS84 +to +proj=ortho +ellps=WGS84
-r <<EOF
>77.1S 68W
>EOF
-1320235.47 -6217160.44 0.00
Bad coords:
cs2cs +over +proj=latlon +ellps=WGS84 +to +proj=ortho +ellps=WGS84
-r <<EOF
>72.5S 142.5E
>EOF
Rel. 4.9.1, 04 March 2015
<cs2cs>: while processing file: <stdin>, line 1
pj_transform(): tolerance condition error
* * 0.00
Confirmed with most recent release:
$ cs2cs +over +proj=latlon +ellps=WGS84 +to +proj=ortho +ellps=WGS84 -r <<EOF
> 72.5S 142.5E
> EOF
Rel. 4.9.3, 15 August 2016
<cs2cs>: while processing file: <stdin>, line 1
pj_transform(): tolerance condition error
* * 0.00
Same results with cs2cs
from master.
With the ortho projection, that point is in Antarctica. From my perspective it seems as if it is on the other side of the globe. Some type of out of bounds type of error might be reasonable response from proj.4.
So I had a proper look at this, instead of just confirming the results with the most recent version of Proj.4, and there is actually two things at play here:
-r
flag.+lon_0=140E
With these adjustments the cs2cs
call now looks something like:
> echo 72.5S 142.5E | cs2cs -r +proj=latlon +to +proj=ortho +lon_0=140E
83659.49 -6082937.37 0.00
Note that +over
is not needed in this case.
For the rest of the projections you mention, I bet you run into something similar.
@kbevers @micahcochran Thanks for this, I will add some bits to our software to catch this scenario. Appreciate the help.
I have noticed that coordinate transforms between certain projections are failing upon calling the transform from proj4. This does not happen with all coordinates, and not with all projections.
The projections I have been having this problem with are: Orthographic Transverse Mercator OSGB Geostationary Gnomonic
To illustrate the problem I am experiencing with some coordinates but not others, here is an example:
If this is not a bug, but it is in fact a problem with the way that we are invoking proj4's transformations, I would appreciate a chat about it so that we can configure our software to catch and correct these problems before going anywhere near the actual transforms.
Thank you, and merry christmas and things.