public static XYZ CoordinateTransform(Geo.Coordinates.IXYZ old, XyzFrameConvertParam p) { double X, Y, Z; X = p.Dx + old.X * (1 + p.m) + (old.Y * p.RzRad - old.Z * p.RyRad); Y = p.Dy + old.Y * (1 + p.m) + (old.Z * p.RxRad - old.X * p.RzRad); Z = p.Dz + old.Z * (1 + p.m) + (old.X * p.RyRad - old.Y * p.RxRad); return(new XYZ(X, Y, Z)); }
/// <summary> /// 布尔莎七参数模型坐标转换,从空间直角坐标到空间直角坐标 /// </summary> /// <param name="old"></param> /// <param name="info"></param> /// <returns></returns> ///坐标转换时都是转XYZ,然后再将XYZ转换成BLH和xy /// WGS-84 --> BJZ54 ///-15.415, 157.025, 94.74, 0.312, 0.08, 0.102, -1.465e-6 /*全国*/ ///-14.756, 145.798, 100.886, 0.618, 0.255, 0.302, -0.439e-6 /*东南局部*/ /// BJZ54 --> DXZ88 ///16.5, -152.9, -91.8, -0.226, -0.003, 0.0, 1.22e-6 public static SpatialRectCoordinate CoordinateTransform(Geo.Coordinates.IXYZ old, TransformParameters p) { double X, Y, Z; double rou = 206264.80624709635515647335733078;// 3600 * 180 / Consts.PI; X = p.Dx + old.X * (1 + p.m) + (old.Y * p.Ez - old.Z * p.Ey) / rou; Y = p.Dy + old.Y * (1 + p.m) + (old.Z * p.Ex - old.X * p.Ez) / rou; Z = p.Dz + old.Z * (1 + p.m) + (old.X * p.Ey - old.Y * p.Ex) / rou; return(new SpatialRectCoordinate(X, Y, Z)); }