Horizontal datum defining the standard datum information.
상속: Datum, IHorizontalDatum
 /// <summary>
 /// Creates an instance of a Geographic Coordinate System
 /// </summary>
 /// <param name="angularUnit">Angular units</param>
 /// <param name="horizontalDatum">Horizontal datum</param>
 /// <param name="primeMeridian">Prime meridian</param>
 /// <param name="axisInfo">Axis info</param>
 /// <param name="name">Name</param>
 /// <param name="authority">Authority name</param>
 /// <param name="authorityCode">Authority-specific identification code.</param>
 /// <param name="alias">Alias</param>
 /// <param name="abbreviation">Abbreviation</param>
 /// <param name="remarks">Provider-supplied remarks</param>
 internal GeographicCoordinateSystem(AngularUnit angularUnit, HorizontalDatum horizontalDatum, PrimeMeridian primeMeridian, List <AxisInfo> axisInfo, string name, string authority, long authorityCode, string alias, string abbreviation, string remarks)
     :
     base(horizontalDatum, axisInfo, name, authority, authorityCode, alias, abbreviation, remarks)
 {
     AngularUnit   = angularUnit;
     PrimeMeridian = primeMeridian;
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of a projected coordinate system
 /// </summary>
 /// <param name="datum">Horizontal datum</param>
 /// <param name="geographicCoordinateSystem">Geographic coordinate system</param>
 /// <param name="linearUnit">Linear unit</param>
 /// <param name="projection">Projection</param>
 /// <param name="axisInfo">Axis info</param>
 /// <param name="name">Name</param>
 /// <param name="authority">Authority name</param>
 /// <param name="code">Authority-specific identification code.</param>
 /// <param name="alias">Alias</param>
 /// <param name="abbreviation">Abbreviation</param>
 /// <param name="remarks">Provider-supplied remarks</param>
 internal ProjectedCoordinateSystem(HorizontalDatum datum, GeographicCoordinateSystem geographicCoordinateSystem,
                                    LinearUnit linearUnit, IProjection projection, List <AxisInfo> axisInfo,
                                    string name, string authority, long code, string alias,
                                    string remarks, string abbreviation)
     : base(datum, axisInfo, name, authority, code, alias, abbreviation, remarks)
 {
     GeographicCoordinateSystem = geographicCoordinateSystem;
     LinearUnit = linearUnit;
     Projection = projection;
 }
 /// <summary>
 /// Creates an instance of HorizontalCoordinateSystem
 /// </summary>
 /// <param name="datum">Horizontal datum</param>
 /// <param name="axisInfo">Axis information</param>
 /// <param name="name">Name</param>
 /// <param name="authority">Authority name</param>
 /// <param name="code">Authority-specific identification code.</param>
 /// <param name="alias">Alias</param>
 /// <param name="abbreviation">Abbreviation</param>
 /// <param name="remarks">Provider-supplied remarks</param>
 internal HorizontalCoordinateSystem(HorizontalDatum datum, List <AxisInfo> axisInfo,
                                     string name, string authority, long code, string alias,
                                     string remarks, string abbreviation)
     : base(name, authority, code, alias, abbreviation, remarks)
 {
     HorizontalDatum = datum;
     if (axisInfo.Count != 2)
     {
         throw new ArgumentException("Axis info should contain two axes for horizontal coordinate systems");
     }
     base.AxisInfo = axisInfo;
 }
 internal GeocentricCoordinateSystem(HorizontalDatum datum, LinearUnit linearUnit, PrimeMeridian primeMeridian, List <AxisInfo> axisInfo,
                                     string name, string authority, long code, string alias,
                                     string remarks, string abbreviation)
     : base(name, authority, code, alias, abbreviation, remarks)
 {
     HorizontalDatum = datum;
     LinearUnit      = linearUnit;
     PrimeMeridian   = primeMeridian;
     if (axisInfo.Count != 3)
     {
         throw new ArgumentException("Axis info should contain three axes for geocentric coordinate systems");
     }
     base.AxisInfo = axisInfo;
 }
예제 #5
0
        /// <summary>
        /// Checks whether the values of this instance is equal to the values of another instance.
        /// Only parameters used for coordinate system are used for comparison.
        /// Name, abbreviation, authority, alias and remarks are ignored in the comparison.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns>True if equal</returns>
        public override bool EqualParams(object obj)
        {
            if (!(obj is HorizontalDatum))
            {
                return(false);
            }
            HorizontalDatum datum = obj as HorizontalDatum;

            if (datum.Wgs84Parameters == null && this.Wgs84Parameters != null)
            {
                return(false);
            }
            if (datum.Wgs84Parameters != null && !datum.Wgs84Parameters.Equals(this.Wgs84Parameters))
            {
                return(false);
            }
            return((datum != null && this.Ellipsoid != null &&
                    datum.Ellipsoid.EqualParams(this.Ellipsoid) || datum == null && this.Ellipsoid == null) && this.DatumType == datum.DatumType);
        }
예제 #6
0
        public IHorizontalDatum CreateDatum(int datumType)
        {
            IHorizontalDatum datum = null;

            switch (datumType)
            {
            case (int)RgSRDatumType.RgSRDatum_WGS1984:
                IEllipsoid ellipsoid = this.CreateSpheroid((int)RgSRSpheroidType.RgSRSpheroid_WGS1984);
                datum = new HorizontalDatum(ellipsoid, null, DatumType.HD_Geocentric, "World Geodetic System 1984", "EPSG", 6326, String.Empty, "EPSG's WGS 84 datum has been the then current realisation. No distinction is made between the original WGS 84 frame, WGS 84 (G730), WGS 84 (G873) and WGS 84 (G1150). Since 1997, WGS 84 has been maintained within 10cm of the then current ITRF.", String.Empty);
                break;

            case (int)RgSRDatumType.RgSRDatum_Beijing1954:
                IEllipsoid ellipsoid2 = this.CreateSpheroid((int)RgSRSpheroidType.RgSRSpheroid_Krasovsky1940);
                datum = new HorizontalDatum(ellipsoid2, null, DatumType.HD_Geocentric, "D_Beijing1954", "EPSG", 6214, String.Empty, "", String.Empty);
                break;

            case (int)RgSRDatumType.RgSRDatum_Xian1980:
                IEllipsoid ellipsoid3 = this.CreateSpheroid((int)RgSRSpheroid2Type.RgSRSpheroid_Xian1980);
                datum = new HorizontalDatum(ellipsoid3, null, DatumType.HD_Geocentric, "D_Xian1980", "EPSG", 6610, String.Empty, "", String.Empty);
                break;
            }
            return(datum);
        }
		/// <summary>
		/// 
		/// </summary>
		/// <param name="tokenizer"></param>
		/// <returns></returns>
		private static IHorizontalDatum ReadHorizontalDatum(WktStreamTokenizer tokenizer)
		{
			//DATUM["OSGB 1936",SPHEROID["Airy 1830",6377563.396,299.3249646,AUTHORITY["EPSG","7001"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6277"]]
			Wgs84ConversionInfo wgsInfo = null;
			string authority = String.Empty;
			long authorityCode = -1;

			tokenizer.ReadToken("[");
			string name = tokenizer.ReadDoubleQuotedWord();
			tokenizer.ReadToken(",");
			tokenizer.ReadToken("SPHEROID");
			IEllipsoid ellipsoid = ReadEllipsoid(tokenizer);
			tokenizer.NextToken();
			while (tokenizer.GetStringValue() == ",")
			{
				tokenizer.NextToken();
				if (tokenizer.GetStringValue() == "TOWGS84")
				{
					wgsInfo = ReadWGS84ConversionInfo(tokenizer);
					tokenizer.NextToken();
				}
				else if (tokenizer.GetStringValue() == "AUTHORITY")
				{
					tokenizer.ReadAuthority(ref authority, ref authorityCode);
					tokenizer.ReadToken("]");
				}
			}
			// make an assumption about the datum type.
			IHorizontalDatum horizontalDatum = new HorizontalDatum(ellipsoid, wgsInfo, DatumType.HD_Geocentric, name, authority, authorityCode, String.Empty, String.Empty, String.Empty);

			return horizontalDatum;
		}
예제 #8
0
        /*
         * /// <summary>
         * /// Creates a <see cref="ILocalDatum"/>.
         * /// </summary>
         * /// <param name="name">Name of datum</param>
         * /// <param name="datumType">Datum type</param>
         * /// <returns></returns>
         * public ILocalDatum CreateLocalDatum(string name, DatumType datumType)
         * {
         *  throw new NotImplementedException();
         * }
         */

        /*
         * /// <summary>
         * /// Creates a <see cref="IVerticalDatum"/> from an enumerated type value.
         * /// </summary>
         * /// <param name="name">Name of datum</param>
         * /// <param name="datumType">Type of datum</param>
         * /// <returns>Vertical datum</returns>
         * public IVerticalDatum CreateVerticalDatum(string name, DatumType datumType)
         * {
         *  throw new NotImplementedException();
         * }
         */

        /*
         * /// <summary>
         * /// Creates a <see cref="IVerticalCoordinateSystem"/> from a <see cref="IVerticalDatum">datum</see> and <see cref="LinearUnit">linear units</see>.
         * /// </summary>
         * /// <param name="name">Name of vertical coordinate system</param>
         * /// <param name="datum">Vertical datum</param>
         * /// <param name="verticalUnit">Unit</param>
         * /// <param name="axis">Axis info</param>
         * /// <returns>Vertical coordinate system</returns>
         * public IVerticalCoordinateSystem CreateVerticalCoordinateSystem(string name, IVerticalDatum datum, ILinearUnit verticalUnit, AxisInfo axis)
         * {
         *  throw new NotImplementedException();
         * }
         */
        /// <summary>
        /// Creates a <see cref="CreateGeocentricCoordinateSystem"/> from a <see cref="HorizontalDatum">datum</see>,
        /// <see cref="LinearUnit">linear unit</see> and <see cref="PrimeMeridian"/>.
        /// </summary>
        /// <param name="name">Name of geocentric coordinate system</param>
        /// <param name="datum">Horizontal datum</param>
        /// <param name="linearUnit">Linear unit</param>
        /// <param name="primeMeridian">Prime meridian</param>
        /// <returns>Geocentric Coordinate System</returns>
        public GeocentricCoordinateSystem CreateGeocentricCoordinateSystem(string name, HorizontalDatum datum, LinearUnit linearUnit, PrimeMeridian primeMeridian)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentException("Invalid name");
            }

            var info = new List <AxisInfo>(3);

            info.Add(new AxisInfo("X", AxisOrientationEnum.Other));
            info.Add(new AxisInfo("Y", AxisOrientationEnum.Other));
            info.Add(new AxisInfo("Z", AxisOrientationEnum.Other));
            return(new GeocentricCoordinateSystem(datum, linearUnit, primeMeridian, info, name, string.Empty, -1, string.Empty, string.Empty, string.Empty));
        }
예제 #9
0
        /// <summary>
        /// Creates a <see cref="GeographicCoordinateSystem"/>, which could be Lat/Lon or Lon/Lat.
        /// </summary>
        /// <param name="name">Name of geographical coordinate system</param>
        /// <param name="angularUnit">Angular units</param>
        /// <param name="datum">Horizontal datum</param>
        /// <param name="primeMeridian">Prime meridian</param>
        /// <param name="axis0">First axis</param>
        /// <param name="axis1">Second axis</param>
        /// <returns>Geographic coordinate system</returns>
        public GeographicCoordinateSystem CreateGeographicCoordinateSystem(string name, AngularUnit angularUnit, HorizontalDatum datum, PrimeMeridian primeMeridian, AxisInfo axis0, AxisInfo axis1)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentException("Invalid name");
            }

            var info = new List <AxisInfo>(2);

            info.Add(axis0);
            info.Add(axis1);
            return(new GeographicCoordinateSystem(angularUnit, datum, primeMeridian, info, name, string.Empty, -1, string.Empty, string.Empty, string.Empty));
        }