GeoProjection Class
A map projection: converts longitudes and latitudes to points of a plane, in radii of the Earth, with y increasing to the north. Scale and translate the result to draw a map.
public abstract class GeoProjectionRemarks
The formulas are ports of d3-geo and d3-geo-projection (ISC license, Copyright Mike Bostock).
Constructors
| Name | Description |
|---|---|
| GeoProjection() | Initializes a new instance of the GeoProjection class. |
GeoProjection()
GeoProjection.csInitializes a new instance of the GeoProjection class.
protected GeoProjection()Properties
| Name | Description |
|---|---|
| CenterLongitude | Gets the longitude at the center of the map, in degrees. The default is 0. |
| HasStraightMeridians | Gets a value that indicates whether the meridians are straight lines, so a line along a meridian needs no intermediate points. The default is true. |
| HasStraightParallels | Gets a value that indicates whether the parallels are straight lines. The default is true. |
| MaxLatitude | Gets the largest latitude the projection draws, in degrees: GeoProjection.Project moves the latitudes past it to it. The default is 90. |
CenterLongitude
GeoProjection.csHasStraightMeridians
GeoProjection.csHasStraightParallels
GeoProjection.csMaxLatitude
GeoProjection.csGets the largest latitude the projection draws, in degrees: GeoProjection.Project moves the latitudes past it to it. The default is 90.
public virtual double MaxLatitude { get; }Property value
Methods
| Name | Description |
|---|---|
| Invert(double, double) | Converts a point of the plane back to a position: the inverse of GeoProjection.Project. |
| InvertRadians(double, double) | Converts a point of the plane back to a position, in radians. |
| Project(GeoPosition) | Projects a position to a point of the plane. |
| Project(double, double) | Projects a position to a point of the plane. |
| ProjectRadians(double, double) | Projects a position, in radians. |
Invert(double, double)
GeoProjection.csConverts a point of the plane back to a position: the inverse of GeoProjection.Project.
public GeoPosition? Invert(double x, double y)Parameters
xdouble- The x coordinate, in radii of the Earth.
ydouble- The y coordinate, in radii of the Earth, increasing to the north.
Returns
GeoPosition? The position, with a longitude from -180 to 180, or null when the point is outside of the map or the projection has no inverse.
InvertRadians(double, double)
GeoProjection.csConverts a point of the plane back to a position, in radians.
Parameters
Returns
(double Lambda, double Phi)? The longitude and the latitude, in radians, or null when the point is outside of the map or the projection has no inverse. The default returns null.
Project overloads
Project(GeoPosition)
GeoProjection.csProjects a position to a point of the plane.
public (double X, double Y) Project(GeoPosition position)Parameters
positionGeoPosition- The position. The altitude is ignored.
Returns
(double X, double Y) The point, in radii of the Earth, with y increasing to the north.
Project(double, double)
GeoProjection.csProjectRadians(double, double)
Projects a position, in radians.
Parameters
lambdadouble- The longitude, in radians.
phidouble- The latitude, in radians, already limited to
GeoProjection.MaxLatitude.
Returns
(double X, double Y) The point, in radii of the Earth, with y increasing to the north.