MercatorConversion Class

The Mercator projection on an ellipsoid (EPSG methods 9804, 9805 and 1044), as World Mercator (EPSG:3395) uses it, or on a sphere whose radius is the semi-major axis of the ellipsoid (EPSG method 1024, the pseudo-Mercator of Web Mercator, EPSG:3857) when MercatorConversion.IsSpherical is true.

public sealed class MercatorConversion : CoordinateConversion

Remarks

Unlike MercatorProjection, which draws maps, it does not limit the latitudes: the poles are at infinity. CoordinateConversion.LatitudeOfOrigin is the latitude whose northing is the false northing, 0 for the usual definitions.

Inheritance
CoordinateConversion MercatorConversion

Constructors

NameDescription
MercatorConversion()

MercatorConversion()

MercatorConversion.cs
public MercatorConversion()

No documentation is available.

Properties

NameDescription
IsSphericalGets a value that indicates whether the formulas are those of a sphere whose radius is the semi-major axis of the ellipsoid, as for Web Mercator. The default is false.
ScaleFactorGets the scale factor on the equator. It is ignored when MercatorConversion.StandardParallel is set. The default is 1.
StandardParallelGets the latitude whose scale is true, in degrees (the Mercator 2SP), or null to use MercatorConversion.ScaleFactor. The default is null.

Gets a value that indicates whether the formulas are those of a sphere whose radius is the semi-major axis of the ellipsoid, as for Web Mercator. The default is false.

public bool IsSpherical { get; init; }

Property value

bool

Gets the scale factor on the equator. It is ignored when MercatorConversion.StandardParallel is set. The default is 1.

public double ScaleFactor { get; init; }

Property value

double

StandardParallel

MercatorConversion.cs

Gets the latitude whose scale is true, in degrees (the Mercator 2SP), or null to use MercatorConversion.ScaleFactor. The default is null.

public double? StandardParallel { get; init; }

Property value

double?

Methods

NameDescription
Project(double, double, Ellipsoid)Projects a longitude and a latitude.
Unproject(double, double, Ellipsoid)Converts an easting and a northing back to a longitude and a latitude: the inverse of CoordinateConversion.Project.

Project(double, double, Ellipsoid)

MercatorConversion.cs

Projects a longitude and a latitude.

public override (double Easting, double Northing) Project(double lambda, double phi, Ellipsoid ellipsoid)

Parameters

lambda double
The longitude from the prime meridian, in radians.
phi double
The latitude, in radians.
ellipsoid Ellipsoid
The ellipsoid of the longitudes and the latitudes.

Returns

(double Easting, double Northing) The easting and the northing, in meters.

Unproject(double, double, Ellipsoid)

MercatorConversion.cs

Converts an easting and a northing back to a longitude and a latitude: the inverse of CoordinateConversion.Project.

public override (double Lambda, double Phi) Unproject(double easting, double northing, Ellipsoid ellipsoid)

Parameters

easting double
The easting, in meters.
northing double
The northing, in meters.
ellipsoid Ellipsoid
The ellipsoid of the longitudes and the latitudes.

Returns

(double Lambda, double Phi) The longitude from the prime meridian and the latitude, in radians.