Handling of projections with towgs84 parameter
|Reported by:||siramon||Owned by:||madair|
Currently the transformation between projections with a +towgs84 and non wgs84 projections do not work correctly. The configured shifting towards WGS84 is ignored.
For example the transformation between a Swiss CH1903/LV03 projection (EPSG:21781) and Spherical Mercator (EPSG:900913) will result like this: 699212,227132 --> 973920.41319,5972983.93373 which is not correct. It should be: 699212,227132 --> 973791.60867,5972764.60117
The attached patch (Patch 1) will transform any source-projection with a towgs84-parameter first to the WGS84 projection and then to the desired destination projection. This works also the other way around.
There is already a workaround handling some Spherical Mercator transformation first to WGS84. This workaround does not work for the example above because dest.datum_params (which is actually only set, if there is a towgs84-parameter ??) is set in the above scenario and therefore the workaround doesn't handle it correctly.
Perhaps it's even possible to replace the current implemented workaround completely with the new one (Patch 2 handles this scenario).
Kind regards Rolf