Converting Gauss-Kruger(Slo) to WGS84

Jun 20, 2010 at 3:53 PM
Edited Jun 20, 2010 at 3:59 PM
Hi! I'm trying to convert Gauss-Kruger coordinates to wgs84. An example of the desired result is: http://www.geopedia.si/#T105_x461220_y104376_s20_b2_vT

Input coordinates are Y:461220, X:104376. Judging by http://osgeo-org.1803224.n2.nabble.com/Slovenian-projection-td2868386.html I'm dealing with EPSG:3787 or EPSG:3794 (EPSG:2170 seems to equal 3783 minus the false_northing).

I've used the following wkts (from http://spatialreference.org):

string wkt3787 = "PROJCS[\"MGI / Slovene National Grid\",GEOGCS[\"MGI\",DATUM[\"D_MGI\",SPHEROID[\"Bessel_1841\",6377397.155,299.1528128]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",15],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",-5000000],UNIT[\"Meter\",1]]";
and
string wkt3794 = "PROJCS[\"Slovenia 1996 / Slovene National Grid\",GEOGCS[\"Slovenia 1996\",DATUM[\"D_Slovenia_Geodetic_Datum_1996\",SPHEROID[\"GRS_1980\",6378137,298.257222101]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",15],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",-5000000],UNIT[\"Meter\",1]]";

I'm getting the following results:
3787: 14°29'54.66'' 46°5'0.02''
3794: 14°29'55.03'' 46°4'41.07''

The desired result is:
14°29'37.6'' 46°4'56.7''

The transformation code is pretty straightforward:
ICoordinateSystem src = ProjNet.Converters.WellKnownText.CoordinateSystemWktReader.Parse(wkt) as ICoordinateSystem;
ICoordinateSystem wgs84 = ProjNet.CoordinateSystems.GeographicCoordinateSystem.WGS84;
ICoordinateTransformation transform = ctfc.CreateFromCoordinateSystems(src, wgs84);
double[] gkt = transform.MathTransform.Transform(new double[] { p.X, p.Y });

Any help or pointers in the right direction would be appreciated!

Goran