C# Класс csShared.Utils.CoordinateUtils

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
MConvertLatLongStringToDouble System.Text.RegularExpressions.Regex

Открытые методы

Метод Описание
Area ( List Points ) : double
AreaLatLon ( List Points ) : double
Bearing ( double pLat1, double pLon1, double pLat2, double pLon2 ) : double

Calculates the bearing in degrees for the line from point 1 (lat1, lon1) to point 2 (lat2, lon2).

CalculatePointSphere2D ( double pLatitudeDeg, double pLongitudeDeg, double pDistance, double pAngleDeg, double &pNewLatitudeDegrees, double &pNewLongitudeDegrees ) : void

Translates a position, spherical implementation The position in translated in the azimuth direction of the angle x, y and by a distance of sqrt(x^2, Y^2).

CheckCoordinate ( CoordinateType pCoordinateType, CoordinateDirection pCoordinateDirection, string pValue ) : string

Checks the range of the coordinate and returns the error message if not OK.

ConvertCoordinateFromXY ( BoundingBox box, CoordinateType coordinateType ) : BoundingBox

Converts the coordinate from raw (map) format to the selected coordinate unit.

ConvertCoordinateFromXY ( SharpMap point, CoordinateType coordinateType ) : SharpMap.Geometries.System.Windows.Point

Converts the coordinate from raw (map) format to the selected coordinate unit.

ConvertCoordinateToXY ( BoundingBox box, CoordinateType coordinateType ) : BoundingBox

Converts the coordinate from the selected coordinate unit to raw (map) format.

ConvertCoordinateToXY ( SharpMap point, CoordinateType coordinateType ) : SharpMap.Geometries.System.Windows.Point

Converts the coordinate from the selected coordinate unit to raw (map) format.

ConvertRDToLonLat ( double x, double y, double &longitude, double &latitude ) : void

Convert RD (rijksdriehoek) to WGS84.

CoordinateToString ( CoordinateType pCoordinateType, double pLatitude, double pLongitude, string &pWestEastValue, string &pNorthSouthValue ) : void

Formats the coordinate according to current setting.

DecimalDegreestoDegreeMinuteSecond ( double pCoordinate, CoordinateDirection pCoordinateDirection ) : string

Convert decimal degrees (DD) to degree, minute, second (DMS) notation.

Deg2Rad ( double pDegrees ) : double
Distance ( System.Windows.Point pPoint1, System.Windows.Point pPoint2 ) : double

Calculates the distance between the specified point1 and point2.

Distance ( double pLat1, double pLon1, double pLat2, double pLon2, char pUnit = 'K' ) : double

Calculates the distance between the specified point1 (lat1, lon1) and point2 (lat2, lon2).

FormattedCoordinateToDouble ( CoordinateType pCoordinateType, string pWestEastValue, string pNorthSouthValue, double &pLatitude, double &pLongitude ) : void

Retrieves latitude and longitude in degrees from the string values presented in the given coordinate type.

LatLon2Rd ( System.Windows.Point pLatLon ) : System.Windows.Point

Convert a lat/lon point to a RD point.

LatLonDeg2Rd ( System.Windows.Point pLatLon ) : System.Windows.Point

Convert a lat/lon point to a RD point.

LatLonDegreesToXYPoint ( double pLatitude, double pLongitude ) : System.Windows.Point

Converts the latitude longitude in degrees to XY point.

LatLonRadToXYPoint ( double pLatitude, double pLongitude ) : System.Windows.Point

Converts the latitude and longitude in radians to XYPoint.

LatitudeLongitudeDegreesFromLatitudeLongitudeString ( string pLatitude, string pLongitude ) : System.Windows.Point

Gets the latitude and the longitude in degrees from a latitude longitude string.

LonLat2Rd ( double pLongitude, double pLatitude, double &pRdX, double &pRdY ) : void

Convert longitude/latitude to 'Rijksdriehoek' coordinates.

RD2lat ( double b, double c ) : double
RD2lng ( double b, double c ) : double
Rad2Deg ( double pRadians ) : double
Rd2LonLat ( double pRdX, double pRdY ) : Position

Convert 'Rijksdriehoek' coordinates to longitude/latitude in degrees.

Rd2LonLat ( double pRdX, double pRdY, double &pLongitude, double &pLatitude ) : void

Convert 'Rijksdriehoek' coordinates to longitude/latitude in degrees.

Rd2LonLat2 ( double pRdX, double pRdY, double &pLongitude, double &pLatitude ) : void
Rd2LonLatAsPoint ( double pRdX, double pRdY ) : System.Windows.Point

Convert 'Rijksdriehoek' coordinates to longitude/latitude in degrees.

TransformCoordinates ( List points, int sourceProjection, int destProjection ) : List
TransformCoordinates ( List points, string sourceProjection, string destProjection ) : List
XYPointToLatLonDegrees ( double pX, double pY, double &pLatitude, double &pLongitude ) : void

Converts the XYPoint to latitude longitude in degrees.

XYPointToLatLonRad ( double pX, double pY, double &pLatitude, double &pLongitude ) : void

Converts the XYPoint to latitude longitude in radians.

Приватные методы

Метод Описание
GetCoordinateDegreesFromDegreeMinuteSecond ( string pValue ) : double

Gets the coordinate degrees from degree minute second.

pj_free ( IntPtr pointer ) : void
pj_init_plus ( string init ) : IntPtr
pj_is_latlong ( IntPtr coordPointer ) : int
pj_transform ( IntPtr srcPrj, IntPtr destPrj, int nPoints, int offset, double &x, double &y, double &z ) : int

Описание методов

Area() публичный статический Метод

public static Area ( List Points ) : double
Points List
Результат double

AreaLatLon() публичный статический Метод

public static AreaLatLon ( List Points ) : double
Points List
Результат double

Bearing() публичный статический Метод

Calculates the bearing in degrees for the line from point 1 (lat1, lon1) to point 2 (lat2, lon2).
public static Bearing ( double pLat1, double pLon1, double pLat2, double pLon2 ) : double
pLat1 double
pLon1 double
pLat2 double
pLon2 double
Результат double

CalculatePointSphere2D() публичный статический Метод

Translates a position, spherical implementation The position in translated in the azimuth direction of the angle x, y and by a distance of sqrt(x^2, Y^2).
public static CalculatePointSphere2D ( double pLatitudeDeg, double pLongitudeDeg, double pDistance, double pAngleDeg, double &pNewLatitudeDegrees, double &pNewLongitudeDegrees ) : void
pLatitudeDeg double Latitude of start coordinate in degrees.
pLongitudeDeg double Longitude of start coordinate in degrees.
pDistance double The distance to move in meters.
pAngleDeg double The angle to move under in degrees.
pNewLatitudeDegrees double The p new latitude degrees.
pNewLongitudeDegrees double The p new longitude degrees.
Результат void

CheckCoordinate() публичный статический Метод

Checks the range of the coordinate and returns the error message if not OK.
public static CheckCoordinate ( CoordinateType pCoordinateType, CoordinateDirection pCoordinateDirection, string pValue ) : string
pCoordinateType CoordinateType Type of the coordinate.
pCoordinateDirection CoordinateDirection The coordinate direction.
pValue string The value.
Результат string

ConvertCoordinateFromXY() публичный статический Метод

Converts the coordinate from raw (map) format to the selected coordinate unit.
public static ConvertCoordinateFromXY ( BoundingBox box, CoordinateType coordinateType ) : BoundingBox
box BoundingBox The box.
coordinateType CoordinateType Type of the coordinate.
Результат BoundingBox

ConvertCoordinateFromXY() публичный статический Метод

Converts the coordinate from raw (map) format to the selected coordinate unit.
public static ConvertCoordinateFromXY ( SharpMap point, CoordinateType coordinateType ) : SharpMap.Geometries.System.Windows.Point
point SharpMap The point.
coordinateType CoordinateType Type of the coordinate.
Результат SharpMap.Geometries.System.Windows.Point

ConvertCoordinateToXY() публичный статический Метод

Converts the coordinate from the selected coordinate unit to raw (map) format.
public static ConvertCoordinateToXY ( BoundingBox box, CoordinateType coordinateType ) : BoundingBox
box BoundingBox The box.
coordinateType CoordinateType Type of the coordinate.
Результат BoundingBox

ConvertCoordinateToXY() публичный статический Метод

Converts the coordinate from the selected coordinate unit to raw (map) format.
public static ConvertCoordinateToXY ( SharpMap point, CoordinateType coordinateType ) : SharpMap.Geometries.System.Windows.Point
point SharpMap The point.
coordinateType CoordinateType Type of the coordinate.
Результат SharpMap.Geometries.System.Windows.Point

ConvertRDToLonLat() публичный статический Метод

Convert RD (rijksdriehoek) to WGS84.
public static ConvertRDToLonLat ( double x, double y, double &longitude, double &latitude ) : void
x double X in RD
y double Y in RD
longitude double Longitude in WGS84
latitude double Latitude in WGS84
Результат void

CoordinateToString() публичный статический Метод

Formats the coordinate according to current setting.
public static CoordinateToString ( CoordinateType pCoordinateType, double pLatitude, double pLongitude, string &pWestEastValue, string &pNorthSouthValue ) : void
pCoordinateType CoordinateType Type of the coordinate.
pLatitude double The latitude in degrees.
pLongitude double The longitude in degrees.
pWestEastValue string The west east value in the specified format.
pNorthSouthValue string The north south value in the specified format.
Результат void

DecimalDegreestoDegreeMinuteSecond() публичный статический Метод

Convert decimal degrees (DD) to degree, minute, second (DMS) notation.
public static DecimalDegreestoDegreeMinuteSecond ( double pCoordinate, CoordinateDirection pCoordinateDirection ) : string
pCoordinate double The Coordinate.
pCoordinateDirection CoordinateDirection The direction.
Результат string

Deg2Rad() публичный статический Метод

public static Deg2Rad ( double pDegrees ) : double
pDegrees double
Результат double

Distance() публичный статический Метод

Calculates the distance between the specified point1 and point2.
public static Distance ( System.Windows.Point pPoint1, System.Windows.Point pPoint2 ) : double
pPoint1 System.Windows.Point The point1.
pPoint2 System.Windows.Point The point2.
Результат double

Distance() публичный статический Метод

Calculates the distance between the specified point1 (lat1, lon1) and point2 (lat2, lon2).
public static Distance ( double pLat1, double pLon1, double pLat2, double pLon2, char pUnit = 'K' ) : double
pLat1 double The lat1.
pLon1 double The lon1.
pLat2 double The lat2.
pLon2 double The lon2.
pUnit char The unit (K for kilometers (default), N for nautical miles, or M for miles (default)).
Результат double

FormattedCoordinateToDouble() публичный статический Метод

Retrieves latitude and longitude in degrees from the string values presented in the given coordinate type.
public static FormattedCoordinateToDouble ( CoordinateType pCoordinateType, string pWestEastValue, string pNorthSouthValue, double &pLatitude, double &pLongitude ) : void
pCoordinateType CoordinateType Type of the coordinate.
pWestEastValue string The west east value.
pNorthSouthValue string The north south value.
pLatitude double The latitude in degrees.
pLongitude double The longitude in degrees.
Результат void

LatLon2Rd() публичный статический Метод

Convert a lat/lon point to a RD point.
public static LatLon2Rd ( System.Windows.Point pLatLon ) : System.Windows.Point
pLatLon System.Windows.Point The lat lon point. (x=latitude, y=longitude and in radian)
Результат System.Windows.Point

LatLonDeg2Rd() публичный статический Метод

Convert a lat/lon point to a RD point.
public static LatLonDeg2Rd ( System.Windows.Point pLatLon ) : System.Windows.Point
pLatLon System.Windows.Point The lat lon point. (x=latitude, y=longitude and in degrees)
Результат System.Windows.Point

LatLonDegreesToXYPoint() публичный статический Метод

Converts the latitude longitude in degrees to XY point.
public static LatLonDegreesToXYPoint ( double pLatitude, double pLongitude ) : System.Windows.Point
pLatitude double The p lat.
pLongitude double The p lon.
Результат System.Windows.Point

LatLonRadToXYPoint() публичный статический Метод

Converts the latitude and longitude in radians to XYPoint.
public static LatLonRadToXYPoint ( double pLatitude, double pLongitude ) : System.Windows.Point
pLatitude double The lat.
pLongitude double The lon.
Результат System.Windows.Point

LatitudeLongitudeDegreesFromLatitudeLongitudeString() публичный статический Метод

Gets the latitude and the longitude in degrees from a latitude longitude string.
public static LatitudeLongitudeDegreesFromLatitudeLongitudeString ( string pLatitude, string pLongitude ) : System.Windows.Point
pLatitude string The latitude string.
pLongitude string The longitude string.
Результат System.Windows.Point

LonLat2Rd() публичный статический Метод

Convert longitude/latitude to 'Rijksdriehoek' coordinates.
public static LonLat2Rd ( double pLongitude, double pLatitude, double &pRdX, double &pRdY ) : void
pLongitude double The longitude in degrees.
pLatitude double The latitude in degrees.
pRdX double The resulting 'Rijksdriehoek' X.
pRdY double The resulting 'Rijksdriehoek' Y.
Результат void

RD2lat() публичный статический Метод

public static RD2lat ( double b, double c ) : double
b double
c double
Результат double

RD2lng() публичный статический Метод

public static RD2lng ( double b, double c ) : double
b double
c double
Результат double

Rad2Deg() публичный статический Метод

public static Rad2Deg ( double pRadians ) : double
pRadians double
Результат double

Rd2LonLat() публичный статический Метод

Convert 'Rijksdriehoek' coordinates to longitude/latitude in degrees.
public static Rd2LonLat ( double pRdX, double pRdY ) : Position
pRdX double The 'Rijksdriehoek' X.
pRdY double The 'Rijksdriehoek' Y.
Результат DataServer.Position

Rd2LonLat() публичный статический Метод

Convert 'Rijksdriehoek' coordinates to longitude/latitude in degrees.
public static Rd2LonLat ( double pRdX, double pRdY, double &pLongitude, double &pLatitude ) : void
pRdX double The 'Rijksdriehoek' X.
pRdY double The 'Rijksdriehoek' Y.
pLongitude double The resulting longitude in degrees.
pLatitude double The resulting latitude in degrees.
Результат void

Rd2LonLat2() публичный статический Метод

public static Rd2LonLat2 ( double pRdX, double pRdY, double &pLongitude, double &pLatitude ) : void
pRdX double
pRdY double
pLongitude double
pLatitude double
Результат void

Rd2LonLatAsPoint() публичный статический Метод

Convert 'Rijksdriehoek' coordinates to longitude/latitude in degrees.
public static Rd2LonLatAsPoint ( double pRdX, double pRdY ) : System.Windows.Point
pRdX double The 'Rijksdriehoek' X.
pRdY double The 'Rijksdriehoek' Y.
Результат System.Windows.Point

TransformCoordinates() публичный статический Метод

public static TransformCoordinates ( List points, int sourceProjection, int destProjection ) : List
points List
sourceProjection int
destProjection int
Результат List

TransformCoordinates() публичный статический Метод

public static TransformCoordinates ( List points, string sourceProjection, string destProjection ) : List
points List
sourceProjection string
destProjection string
Результат List

XYPointToLatLonDegrees() публичный статический Метод

Converts the XYPoint to latitude longitude in degrees.
public static XYPointToLatLonDegrees ( double pX, double pY, double &pLatitude, double &pLongitude ) : void
pX double The X.
pY double The Y.
pLatitude double The resulting latitude in degrees.
pLongitude double The resulting longitude in degrees.
Результат void

XYPointToLatLonRad() публичный статический Метод

Converts the XYPoint to latitude longitude in radians.
public static XYPointToLatLonRad ( double pX, double pY, double &pLatitude, double &pLongitude ) : void
pX double The X.
pY double The Y.
pLatitude double The resulting latitude.
pLongitude double The resulting longitude.
Результат void

Описание свойств

MConvertLatLongStringToDouble публичное статическое свойство

Convert a string such as 039°32'09,90 to a double A description of the regular expression: 0, zero or one repetitions [Degrees]: A named capture group. [\d{1,3}] Any digit, between 1 and 3 repetitions °0? °0, zero or one repetitions [Minutes]: A named capture group. [\d{1,2}] Any digit, between 1 and 2 repetitions '0? '0, zero or one repetitions [Seconds]: A named capture group. [\d{1,2}[.,]?\d*] \d{1,2}[.,]?\d* Any digit, between 1 and 2 repetitions Any character in this class: [.,], zero or one repetitions Any digit, any number of repetitions
public static Regex,System.Text.RegularExpressions MConvertLatLongStringToDouble
Результат System.Text.RegularExpressions.Regex