Implements the Mercator projection.

This map projection introduced in 1569 by Gerardus Mercator. It is often described as a cylindrical projection, but it must be derived mathematically. The meridians are equally spaced, parallel vertical lines, and the parallels of latitude are parallel, horizontal straight lines, spaced farther and farther apart as their distance from the Equator increases. This projection is widely used for navigation charts, because any straight line on a Mercator-projection map is a line of constant true bearing that enables a navigator to plot a straight-line course. It is less practical for world maps because the scale is distorted; areas farther away from the equator appear disproportionately large. On a Mercator projection, for example, the landmass of Greenland appears to be greater than that of the continent of South America; in actual area, Greenland is smaller than the Arabian Peninsula.

Inheritance: MapProjection
示例#1
0
 protected PseudoMercator(IEnumerable<ProjectionParameter> parameters, Mercator inverse)
     :base(VerifyParameters(parameters), inverse)
 {
     Name = "Pseudo-Mercator";
     Authority = "EPSG";
     AuthorityCode = 3856;
 }
示例#2
0
        /// <summary>
        /// Initializes the MercatorProjection object with the specified parameters.
        /// </summary>
        /// <param name="parameters">List of parameters to initialize the projection.</param>
        /// <param name="isInverse">Indicates whether the projection forward (meters to degrees or degrees to meters).</param>
        /// <remarks>
        /// <para>The parameters this projection expects are listed below.</para>
        /// <list type="table">
        /// <listheader><term>Items</term><description>Descriptions</description></listheader>
        /// <item><term>central_meridian</term><description>The longitude of the point from which the values of both the geographical coordinates on the ellipsoid and the grid coordinates on the projection are deemed to increment or decrement for computational purposes. Alternatively it may be considered as the longitude of the point which in the absence of application of false coordinates has grid coordinates of (0,0).</description></item>
        /// <item><term>latitude_of_origin</term><description>The latitude of the point from which the values of both the geographical coordinates on the ellipsoid and the grid coordinates on the projection are deemed to increment or decrement for computational purposes. Alternatively it may be considered as the latitude of the point which in the absence of application of false coordinates has grid coordinates of (0,0).</description></item>
        /// <item><term>scale_factor</term><description>The factor by which the map grid is reduced or enlarged during the projection process, defined by its value at the natural origin.</description></item>
        /// <item><term>false_easting</term><description>Since the natural origin may be at or near the centre of the projection and under normal coordinate circumstances would thus give rise to negative coordinates over parts of the mapped area, this origin is usually given false coordinates which are large enough to avoid this inconvenience. The False Easting, FE, is the easting value assigned to the abscissa (east).</description></item>
        /// <item><term>false_northing</term><description>Since the natural origin may be at or near the centre of the projection and under normal coordinate circumstances would thus give rise to negative coordinates over parts of the mapped area, this origin is usually given false coordinates which are large enough to avoid this inconvenience. The False Northing, FN, is the northing value assigned to the ordinate.</description></item>
        /// </list>
        /// </remarks>
        protected Mercator(IEnumerable <ProjectionParameter> parameters, Mercator inverse)
            : base(parameters, inverse)
        {
            Authority = "EPSG";
            var scale_factor = GetParameter("scale_factor");

            if (scale_factor == null)             //This is a two standard parallel Mercator projection (2SP)
            {
                _k0           = Math.Cos(lat_origin) / Math.Sqrt(1.0 - _es * Math.Sin(lat_origin) * Math.Sin(lat_origin));
                AuthorityCode = 9805;
                Name          = "Mercator_2SP";
            }
            else             //This is a one standard parallel Mercator projection (1SP)
            {
                _k0  = scale_factor.Value;
                Name = "Mercator_1SP";
            }
        }
示例#3
0
文件: Mercator.cs 项目: maxm/osmuy
 /// <summary>
 /// Returns the inverse of this projection.
 /// </summary>
 /// <returns>IMathTransform that is the reverse of the current projection.</returns>
 public override IMathTransform Inverse()
 {
     if (_inverse == null)
         _inverse = new Mercator(this._Parameters, ! _isInverse);
     return _inverse;
 }
        private static IMathTransform CreateCoordinateOperation(IProjection projection, IEllipsoid ellipsoid, ILinearUnit unit)
        {
            List<ProjectionParameter> parameterList = new List<ProjectionParameter>(projection.NumParameters);
            for (int i = 0; i < projection.NumParameters; i++)
                parameterList.Add(projection.GetParameter(i));

            parameterList.Add(new ProjectionParameter("semi_major", ellipsoid.SemiMajorAxis));
            parameterList.Add(new ProjectionParameter("semi_minor", ellipsoid.SemiMinorAxis));
            parameterList.Add(new ProjectionParameter("unit", unit.MetersPerUnit));
            IMathTransform transform = null;
            switch (projection.ClassName.ToLower(CultureInfo.InvariantCulture).Replace(' ', '_'))
            {
                case "mercator":
                case "mercator_1sp":
                case "mercator_2sp":
                    //1SP
                    transform = new Mercator(parameterList);
                    break;
                case "transverse_mercator":
                    transform = new TransverseMercator(parameterList);
                    break;
                case "albers":
                case "albers_conic_equal_area":
                    transform = new AlbersProjection(parameterList);
                    break;
                case "krovak":
                    transform = new KrovakProjection(parameterList);
                    break;
                case "lambert_conformal_conic":
                case "lambert_conformal_conic_2sp":
                case "lambert_conic_conformal_(2sp)":
                    transform = new LambertConformalConic2SP(parameterList);
                    break;
                default:
                    throw new NotSupportedException(String.Format("Projection {0} is not supported.", projection.ClassName));
            }
            return transform;
        }
示例#5
0
		/// <summary>
		/// Returns the inverse of this projection.
		/// </summary>
		/// <returns>IMathTransform that is the reverse of the current projection.</returns>
		public override IMathTransform Inverse()
		{
			if (_inverse == null)
				_inverse = new Mercator(_Parameters.ToProjectionParameter(), this);			
			return _inverse;
		}
示例#6
0
		/// <summary>
		/// Initializes the MercatorProjection object with the specified parameters.
		/// </summary>
		/// <param name="parameters">List of parameters to initialize the projection.</param>
		/// <param name="isInverse">Indicates whether the projection forward (meters to degrees or degrees to meters).</param>
		/// <remarks>
		/// <para>The parameters this projection expects are listed below.</para>
		/// <list type="table">
		/// <listheader><term>Items</term><description>Descriptions</description></listheader>
		/// <item><term>central_meridian</term><description>The longitude of the point from which the values of both the geographical coordinates on the ellipsoid and the grid coordinates on the projection are deemed to increment or decrement for computational purposes. Alternatively it may be considered as the longitude of the point which in the absence of application of false coordinates has grid coordinates of (0,0).</description></item>
		/// <item><term>latitude_of_origin</term><description>The latitude of the point from which the values of both the geographical coordinates on the ellipsoid and the grid coordinates on the projection are deemed to increment or decrement for computational purposes. Alternatively it may be considered as the latitude of the point which in the absence of application of false coordinates has grid coordinates of (0,0).</description></item>
		/// <item><term>scale_factor</term><description>The factor by which the map grid is reduced or enlarged during the projection process, defined by its value at the natural origin.</description></item>
		/// <item><term>false_easting</term><description>Since the natural origin may be at or near the centre of the projection and under normal coordinate circumstances would thus give rise to negative coordinates over parts of the mapped area, this origin is usually given false coordinates which are large enough to avoid this inconvenience. The False Easting, FE, is the easting value assigned to the abscissa (east).</description></item>
		/// <item><term>false_northing</term><description>Since the natural origin may be at or near the centre of the projection and under normal coordinate circumstances would thus give rise to negative coordinates over parts of the mapped area, this origin is usually given false coordinates which are large enough to avoid this inconvenience. The False Northing, FN, is the northing value assigned to the ordinate.</description></item>
		/// </list>
		/// </remarks>
        protected Mercator(IEnumerable<ProjectionParameter> parameters, Mercator inverse)
			: base(parameters, inverse)
		{
			Authority = "EPSG";
			var scale_factor = GetParameter("scale_factor");
			
			if (scale_factor == null) //This is a two standard parallel Mercator projection (2SP)
			{
				_k0 = Math.Cos(lat_origin) / Math.Sqrt(1.0 - _es * Math.Sin(lat_origin) * Math.Sin(lat_origin));
				AuthorityCode = 9805;
				Name = "Mercator_2SP";
			}
			else //This is a one standard parallel Mercator projection (1SP)
			{
				_k0 = scale_factor.Value;
				Name = "Mercator_1SP";
			}
		}