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 : CoordinateConversionRemarks
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
CoordinateConversionMercatorConversion
Constructors
| Name | Description |
|---|---|
| MercatorConversion() |
MercatorConversion()
MercatorConversion.cspublic MercatorConversion()No documentation is available.
Properties
| Name | Description |
|---|---|
| IsSpherical | 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. |
| ScaleFactor | Gets the scale factor on the equator. It is ignored when MercatorConversion.StandardParallel is set. The default is 1. |
| StandardParallel | Gets the latitude whose scale is true, in degrees (the Mercator 2SP), or null to use MercatorConversion.ScaleFactor. The default is null. |
IsSpherical
MercatorConversion.csScaleFactor
MercatorConversion.csGets 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
StandardParallel
MercatorConversion.csGets 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
Methods
| Name | Description |
|---|---|
| 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.csProjects a longitude and a latitude.
public override (double Easting, double Northing) Project(double lambda, double phi, Ellipsoid ellipsoid)Parameters
lambdadouble- The longitude from the prime meridian, in radians.
phidouble- The latitude, in radians.
ellipsoidEllipsoid- 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.csConverts 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
eastingdouble- The easting, in meters.
northingdouble- The northing, in meters.
ellipsoidEllipsoid- The ellipsoid of the longitudes and the latitudes.
Returns
(double Lambda, double Phi) The longitude from the prime meridian and the latitude, in radians.