sweref transformation problem

Apr 19, 2011 at 10:15 AM

Hi

   I am transforming coordinates between sweref 99 utm and sweref 99 12 00, using the wll known text from oracle spatial to describe the coordinate systems

"PROJCS["SWEREF99 TM", GEOGCS [ "SWEREF99", DATUM ["SWEREF99 (EPSG ID 6619)", SPHEROID ["GRS 1980 (EPSG ID 7019)", 6378137.0, 298.257222101]], PRIMEM [ "Greenwich", 0.000000 ], UNIT ["Decimal Degree", 0.0174532925199433]], PROJECTION ["Transverse Mercator"], PARAMETER ["Latitude_Of_Origin", 0.0], PARAMETER ["Central_Meridian", 15.0], PARAMETER ["Scale_Factor", 0.9996], PARAMETER ["False_Easting", 500000.0], PARAMETER ["False_Northing", 0.0], UNIT ["Meter", 1.0]]"


"PROJCS["SWEREF99 12 00", GEOGCS [ "SWEREF99", DATUM ["SWEREF99 (EPSG ID 6619)", SPHEROID ["GRS 1980 (EPSG ID 7019)", 6378137.0, 298.257222101]], PRIMEM [ "Greenwich", 0.000000 ], UNIT ["Decimal Degree", 0.0174532925199433]], PROJECTION ["Transverse Mercator"], PARAMETER ["Latitude_Of_Origin", 0.0], PARAMETER ["Central_Meridian", 12.0], PARAMETER ["Scale_Factor", 1.0], PARAMETER ["False_Easting", 150000.0], PARAMETER ["False_Northing", 0.0], UNIT ["Meter", 1.0]]"

ICoordinateTransformation transformation;

 CoordinateSystemFactory coordFactory = new CoordinateSystemFactory()

 ICoordinateSystem from = coordFactory.CreateFromWkt(fromWkText);

 ICoordinateSystem to = coordFactory.CreateFromWkt(toWkText);

 CoordinateTransformationFactory ctFac = new CoordinateTransformationFactory();

 transformation = ctFac.CreateFromCoordinateSystems(from, to);

 

       public double[] Transform(double x, double y)
        {
            double[] orig = new double[] { x, y };

            double[] transformed = transform.MathTransform.Transform(orig);

            return transformed;
        }

 

The problem is that when I transform an x any and compare the transformed coordinate the swedish surveys online coordinate transformation service the results are wildly different.

http://www.lantmateriet.se/templates/LMV_Koordinattransformation.aspx?id=11499

For example

sweref 99 utm x,y = 6729377.4, 451333.5 is transformed by proj.net to 6937020.374, 463403.83

but the online transformation service gives  6733588.332, 265165.371

I wonder what I am doing wrong?

/shane

 

 

Apr 19, 2011 at 10:42 AM

I also tried using the wktext from SRID.csv which has slight differences in structure (same data trhough). I still got the same result though.