Friday, 6 January 2012

Shift in my Coordinate conversion

Anyone out there with a solution for me??? for the shift am getting in my coordinate conversion....
Yea, I try to convert WGS84 to GDA1994MGA_50 am getting the shift in my result.
I get the WGS84 coordinates @ runtime and I convert SR the below way which results in a shift :( :( .....


private static IGeometry5 ConversionFromWGS84(IGeometry5 geometryFromWGS)
        {
            ISpatialReferenceFactory SRFactory = null

            Type t = Type.GetTypeFromProgID("esriGeometry.SpatialReferenceEnvironment");
            object obj = Activator.CreateInstance(t);
            SRFactory = obj as ISpatialReferenceFactory;

            ISpatialReference srGCS = new GeographicCoordinateSystemClass();
            ISpatialReference srPCS = new ProjectedCoordinateSystemClass();
            srGCS = SRFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984);
            srPCS = SRFactory.CreateProjectedCoordinateSystem(m_Document.FocusMap.SpatialReference.FactoryCode); 
            geometryFromWGS.SpatialReference = srGCS;
            geometryFromWGS.Project(srPCS);
            return geometryFromWGS;
        }


I even tried implementing IGeoTransformation but no luck

sometimes unhappy coding too .....

regards
Rajesh K

No comments:

Post a Comment