⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ellipsoid.cs

📁 Sharp Map 用于制作GIS系统S harp Map 用于制作GIS系统S harp Map 用于制作GIS系统
💻 CS
字号:
// Copyright 2005, 2006 - Morten Nielsen (www.iter.dk)
//
// This file is part of SharpMap.
// SharpMap is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// 
// SharpMap is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.

// You should have received a copy of the GNU Lesser General Public License
// along with SharpMap; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 

using System;
using System.Collections.Generic;
using System.Text;

namespace SharpMap.CoordinateSystems
{
	/// <summary>
	/// The IEllipsoid interface defines the standard information stored with ellipsoid objects.
	/// </summary>
	public class Ellipsoid : Info, IEllipsoid
	{
		/// <summary>
		/// Initializes a new instance of an Ellipsoid
		/// </summary>
		/// <param name="semiMajorAxis">Semi major axis</param>
		/// <param name="semiMinorAxis">Semi minor axis</param>
		/// <param name="inverseFlattening">Inverse flattening</param>
		/// <param name="isIvfDefinitive">Inverse Flattening is definitive for this ellipsoid (Semi-minor axis will be overridden)</param>
		/// <param name="axisUnit">Axis unit</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 Ellipsoid(
			double semiMajorAxis, 
			double semiMinorAxis, 
			double inverseFlattening,
			bool isIvfDefinitive,
			ILinearUnit axisUnit, string name, string authority, long code, string alias, 
			string abbreviation, string remarks)
			: base(name, authority, code, alias, abbreviation, remarks)
		{
			_SemiMajorAxis = semiMajorAxis;
			_InverseFlattening = inverseFlattening;
			_AxisUnit = axisUnit;
			_IsIvfDefinitive = isIvfDefinitive;
			if (isIvfDefinitive)
				_SemiMinorAxis = (1.0 - (1.0 / _InverseFlattening)) * semiMajorAxis;
			else
				_SemiMinorAxis = semiMinorAxis;
		}

		#region Predefined ellipsoids
		/// <summary>
		/// WGS 84 ellipsoid
		/// </summary>
		/// <remarks>
		/// Inverse flattening derived from four defining parameters 
		/// (semi-major axis;
		/// C20 = -484.16685*10e-6;
		/// earth's angular velocity w = 7292115e11 rad/sec;
		/// gravitational constant GM = 3986005e8 m*m*m/s/s).
		/// </remarks>
		public static Ellipsoid WGS84
		{
			get
			{
				return new Ellipsoid(6378137, 0, 298.257223563, true, LinearUnit.Metre, "WGS 84", "EPSG", 7030, "WGS84", "",
					"Inverse flattening derived from four defining parameters (semi-major axis; C20 = -484.16685*10e-6; earth's angular velocity w = 7292115e11 rad/sec; gravitational constant GM = 3986005e8 m*m*m/s/s).");
			}
		}

		/// <summary>
		/// WGS 72 Ellipsoid
		/// </summary>
		public static Ellipsoid WGS72
		{
			get
			{
				return new Ellipsoid(6378135.0, 0, 298.26, true, LinearUnit.Metre, "WGS 72", "EPSG", 7043, "WGS 72", String.Empty, String.Empty);
			}
		}

		/// <summary>
		/// GRS 1980 / International 1979 ellipsoid
		/// </summary>
		/// <remarks>
		/// Adopted by IUGG 1979 Canberra.
		/// Inverse flattening is derived from
		/// geocentric gravitational constant GM = 3986005e8 m*m*m/s/s;
		/// dynamic form factor J2 = 108263e8 and Earth's angular velocity = 7292115e-11 rad/s.")
		/// </remarks>
		public static Ellipsoid GRS80
		{
			get
			{
				return new Ellipsoid(6378137, 0, 298.257222101, true, LinearUnit.Metre, "GRS 1980", "EPSG", 7019, "International 1979", "",
					"Adopted by IUGG 1979 Canberra.  Inverse flattening is derived from geocentric gravitational constant GM = 3986005e8 m*m*m/s/s; dynamic form factor J2 = 108263e8 and Earth's angular velocity = 7292115e-11 rad/s.");
			}
		}

		/// <summary>
		/// International 1924 / Hayford 1909 ellipsoid
		/// </summary>
		/// <remarks>
		/// Described as a=6378388 m. and b=6356909m. from which 1/f derived to be 296.95926. 
		/// The figure was adopted as the International ellipsoid in 1924 but with 1/f taken as
		/// 297 exactly from which b is derived as 6356911.946m.
		/// </remarks>
		public static Ellipsoid International1924
		{
			get
			{
				return new Ellipsoid(6378388, 0, 297, true, LinearUnit.Metre, "International 1924", "EPSG", 7022, "Hayford 1909", String.Empty,
					"Described as a=6378388 m. and b=6356909 m. from which 1/f derived to be 296.95926. The figure was adopted as the International ellipsoid in 1924 but with 1/f taken as 297 exactly from which b is derived as 6356911.946m.");
			}
		}

		/// <summary>
		/// Clarke 1880
		/// </summary>
		/// <remarks>
		/// Clarke gave a and b and also 1/f=293.465 (to 3 decimal places).  1/f derived from a and b = 293.4663077
		/// </remarks>
		public static Ellipsoid Clarke1880
		{
			get
			{
				return new Ellipsoid(20926202, 0, 297, true, LinearUnit.ClarkesFoot, "Clarke 1880", "EPSG", 7034, "Clarke 1880", String.Empty,
					"Clarke gave a and b and also 1/f=293.465 (to 3 decimal places).  1/f derived from a and b = 293.4663077

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -