[Proj] [gdal-dev] gdalwarp EPSG:32662 problem

Stephen Woodbridge woodbri at swoodbridge.com
Mon Feb 10 08:42:14 EST 2014

```On 2/10/2014 3:41 AM, Antti Castrén wrote:
> 2014-02-09 8:40 GMT+02:00 Andre Joost <andre+joost at nurfuerspam.de>:
>> Am 09.02.2014 00:42, schrieb Even Rouault:
>>>
>>> But Antti guess seems right. Instead of +ellps=WGS84 (or +datum=WGS84), if
>>> you
>>> play with the a (semi-major axis) and b (semi-minor axis) parameters, you
>>> can
>>> see that only +a has an influence, so latest proj version seems to use a
>>> spherical version of eqc.
>>
>>
>> If you look at
>> <http://trac.osgeo.org/proj/browser/trunk/proj/src/PJ_eqc.c>
>>
>> and the chapter 12 of Snyders manual, you will only find formulas for the
>> sphere. So I guess there is no other way to calculate eqc.
>>
>> Maybe older versions calculated another radius for the sphere when an
>> ellipsoid was given.
>
> Stephen's "shift" was about 20km south, which correlates quite well if
> you use semi-minor axis of WGS84 as radius of sphere while calculating
> forward, and semi-major axis as radius of sphere while calculating the
> inverse. At latitude of 55 degrees the difference is ca. 20 530 meters
> (55 degrees -> 54.8156 degrees).
>
> There are several different radii of the Earth, and some of them could
> arguably be used in this context in place of semi-major axis.
>
>
> You have to bear in mind that this projection is intended for small
> scale mapping, for example mapping the whole world. In that scale 20
> km is nothing. If you need better representation of the Earth you have
> to use a projection which takes ellipsoidal properties into account.
> Of course the beef in this thread is not about choosing a projection,
> but the change/difference in formulae used, which can create problems
> as Stephen pointed out.

Right, The real issue here what changed between Proj4 4.5 and Proj 4.8
that has caused this shift and how to best correct for it.

I hacked a solution into my problem by changing the reference bbox for
the image to shove it north by 20,000 meters. As you point out maybe I
should have pushed it 20,530 meters.

Anyway, thanks to everyone for taking the time to help me with this. It
is greatly appreciated.

-Steve
```