Пример #1
0
        public GeoPoint(GaussCoordinate xyh, double a, double f)
        {
            try
            {
                //读取高斯平面坐标值,如果是未赋值对象则产生异常
                double x = xyh.x;
                double y = xyh.y;

                ellipsoid  = new ReferenceEllipsoid(a, f);
                gaussCoord = xyh;

                double B, L;
                Geodetic.xy_BL(x, y, out B, out L, xyh.BeltWidth, 0, ellipsoid.a, ellipsoid.f);
                geodeticCoord = new GeodeticCoordinate(B, L);

                dimension = 2;

                try
                {
                    //如果存在高程异常和正常高,则按此式计算大地高
                    double h = xyh.h;
                    if (!dHlIsNull)
                    {
                        geodeticCoord.H = h + dH;
                        double X, Y, Z;
                        Geodetic.BLH_XYZ(B, L, h + dH, out X, out Y, out Z, ellipsoid.a, ellipsoid.f);
                        spatialCoord = new SpatialRectCoordinate(X, Y, Z);
                        dimension    = 3;
                    }
                }
                catch { }
            }
            catch { }
        }
Пример #2
0
        public GeoPoint(SpatialRectCoordinate XYZ, double a, double f)
        {
            try
            {
                //读取空间直角坐标值,如果未赋值则产生异常
                double X = XYZ.X;
                double Y = XYZ.Y;
                double Z = XYZ.Z;

                ellipsoid    = new ReferenceEllipsoid(a, f);
                spatialCoord = XYZ;

                double B, L, H;
                Geodetic.XYZ_BLH(X, Y, Z, out B, out L, out H, ellipsoid.a, ellipsoid.f);
                geodeticCoord = new GeodeticCoordinate(B, L, H);

                double x, y;
                Geodetic.BL_xy(geodeticCoord.B, geodeticCoord.L, out x, out y, ellipsoid.a, ellipsoid.f);
                gaussCoord = new GaussCoordinate(x, y);

                if (!dHlIsNull)
                {
                    gaussCoord.h = H - dH;
                }

                dimension = 3;
            }
            catch { }
        }
Пример #3
0
        public GeoPoint(GeodeticCoordinate BLH, double a, double f)
        {
            try
            {
                //获取大地坐标,如果赋的值是空对象则会产生异常
                double B = BLH.B;
                double L = BLH.L;

                geodeticCoord = BLH;
                ellipsoid     = new ReferenceEllipsoid(a, f);

                double x, y;
                Geodetic.BL_xy(B, L, out x, out y, ellipsoid.a, ellipsoid.f);
                gaussCoord = new GaussCoordinate(x, y);

                dimension = 2;

                try
                {
                    //获取大地高,如果没有大地高,则产生异常,只取二维坐标
                    double H = BLH.H;

                    double X, Y, Z;

                    Geodetic.BLH_XYZ(B, L, H, out X, out Y, out Z, ellipsoid.a, ellipsoid.f);
                    spatialCoord = new SpatialRectCoordinate(X, Y, Z);

                    dimension = 3;
                }
                catch { }
            }
            catch { }
        }
Пример #4
0
        public GeoPoint(double B, double L, double a, double f)
        {
            ellipsoid     = new ReferenceEllipsoid(a, f);
            geodeticCoord = new GeodeticCoordinate(B, L);

            double x, y;

            Geodetic.BL_xy(B, L, out x, out y, ellipsoid.a, ellipsoid.f);
            gaussCoord = new GaussCoordinate(x, y);

            dimension = 2;
        }
Пример #5
0
        /// <summary>
        /// 布尔莎七参数模型坐标转换,从大地坐标到大地坐标
        /// </summary>
        /// <param name="pntBLH"></param>
        /// <param name="eOld"></param>
        /// <param name="eNew"></param>
        /// <param name="param"></param>
        /// <returns></returns>
        public static GeodeticCoordinate CoordinateTransform(GeodeticCoordinate pntBLH, ReferenceEllipsoid eOld, ReferenceEllipsoid eNew, TransformParameters param)
        {
            double X, Y, Z;

            BLH_XYZ(pntBLH.B, pntBLH.L, pntBLH.H, out X, out Y, out Z, eOld.a, eOld.f);

            SpatialRectCoordinate s = CoordinateTransform(new SpatialRectCoordinate(X, Y, Z), param);

            double B, L, H;

            XYZ_BLH(s.X, s.Y, s.Z, out B, out L, out H, eNew.a, eNew.f);
            return(new GeodeticCoordinate(B, L, H));
        }
Пример #6
0
 public GeoPoint(double B, double L, double H, ReferenceEllipsoid e)
     : this(B, L, H, e.a, e.f)
 {
 }
Пример #7
0
 public GeoPoint(GaussCoordinate xyh, ReferenceEllipsoid e)
     : this(xyh, e.a, e.f)
 {
 }
Пример #8
0
 public GeoPoint(SpatialRectCoordinate XYZ, ReferenceEllipsoid e)
     : this(XYZ, e.a, e.f)
 {
 }
Пример #9
0
 public GeoPoint(GeodeticCoordinate BLH, ReferenceEllipsoid e)
     : this(BLH, e.a, e.f)
 {
 }