Struct GeoCoordinateBasic
Basic minimal handling of a geographical coordinate in decimal latitude and longitude format
Implements
Inherited Members
Namespace: FpAssistantCore.Geographical
Assembly: FpAssistantCoreScl.dll
Syntax
public struct GeoCoordinateBasic : IEquatable<GeoCoordinateBasic>
Remarks
No error checking or validation; cut down for speed and saving memory
Constructors
View SourceGeoCoordinateBasic(double, double)
Basic constructor
Declaration
public GeoCoordinateBasic(double latitude, double longitude)
Parameters
| Type | Name | Description |
|---|---|---|
| double | latitude | Latitude value of the coordinate |
| double | longitude | Longitude value of the coordinate |
Remarks
Basic checking or validation so pass through GeoCoordinate constructor and return GeoCoordinateBasic; see example
Examples
GeoCoordinateBasic geoCoordinateBasic = new GeoCoordinate(latitude, longitude).GeoCoordinateBasic;
Properties
View SourceLatitude
The latitude of the geographic position (Latitude in decimal DMS)
Declaration
public double Latitude { get; set; }
Property Value
| Type | Description |
|---|---|
| double | Numerical value of the Latitude |
Remarks
The valid range of latitude values is from -90.0 to 90.0 degrees
Longitude
The longitude of the geographic position (Longitude in decimal DMS)
Declaration
public double Longitude { get; set; }
Property Value
| Type | Description |
|---|---|
| double | Numerical value of the Longitude |
Remarks
This can be any value. For values less than or equal to-180.0 or values greater than 180.0, the value may be wrapped and stored appropriately before it is used. For example, a longitude of 183.0 degrees would become -177.0 degrees
Methods
View SourceAdd(GeoCoordinateBasic)
Adds together two coordinate of GeoCoordinateBasic type
Declaration
public GeoCoordinateBasic Add(GeoCoordinateBasic geoCoordinateBasic)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoCoordinateBasic | geoCoordinateBasic | Coordinate value to be added to coordinate |
Returns
| Type | Description |
|---|---|
| GeoCoordinateBasic | Coordinate of the addition |
Remarks
Latitude can't go above 90 but longitude can wrap around
AddDegreesMinutesSeconds(int, int, double, int, int, double)
Addition of DMS Latitude and Longitude values to coordinate
Declaration
public GeoCoordinateBasic AddDegreesMinutesSeconds(int degreesLatitude, int minutesLatitude, double secondsLatitude, int degreesLongitude, int minutesLongitude, double secondsLongitude)
Parameters
| Type | Name | Description |
|---|---|---|
| int | degreesLatitude | Degrees of latitude |
| int | minutesLatitude | Minutes of latitude |
| double | secondsLatitude | Seconds of latitude |
| int | degreesLongitude | Degrees of longitude |
| int | minutesLongitude | Minutes of longitude |
| double | secondsLongitude | Seconds of longitude |
Returns
| Type | Description |
|---|---|
| GeoCoordinateBasic | Coordinate of the addition |
AddDegreesMinutesSecondsToLatitude(int, int, double)
Addition of DMS Latitude value to coordinate
Declaration
public GeoCoordinateBasic AddDegreesMinutesSecondsToLatitude(int degreesLatitude, int minutesLatitude = 0, double secondsLatitude = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| int | degreesLatitude | Degrees of latitude |
| int | minutesLatitude | Minutes of latitude |
| double | secondsLatitude | Seconds of latitude |
Returns
| Type | Description |
|---|---|
| GeoCoordinateBasic | Coordinate of the addition |
AddDegreesMinutesSecondsToLongitude(int, int, double)
Addition of DMS Longitude value to coordinate
Declaration
public GeoCoordinateBasic AddDegreesMinutesSecondsToLongitude(int degreesLongitude, int minutesLongitude = 0, double secondsLongitude = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| int | degreesLongitude | Degrees of longitude |
| int | minutesLongitude | Minutes of longitude |
| double | secondsLongitude | Seconds of longitude |
Returns
| Type | Description |
|---|---|
| GeoCoordinateBasic | Coordinate of the addition |
AsGeoCoordinate()
Converts to a GeoCoordinate class object
Declaration
public GeoCoordinate AsGeoCoordinate()
Returns
| Type | Description |
|---|---|
| GeoCoordinate | GeoCoordinate |
AsGeography()
Convert to Geography Data Type
Declaration
public string AsGeography()
Returns
| Type | Description |
|---|---|
| string |
Remarks
The Point type for the geography data type represents a single location based on latitude and longitude, the values are measured in degrees
DistanceTo(GeoCoordinateBasic)
Calculates a distance between two GeoCoordinateBasic coordinates, this and one passed as a variable
Declaration
public LinearDistance DistanceTo(GeoCoordinateBasic geoCoordinateBasic)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoCoordinateBasic | geoCoordinateBasic | Coordinate of second point to measure distance to |
Returns
| Type | Description |
|---|---|
| LinearDistance | Distance in Metres |
Equals(GeoCoordinateBasic)
Declaration
public bool Equals(GeoCoordinateBasic other)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoCoordinateBasic | other |
Returns
| Type | Description |
|---|---|
| bool |
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
View SourceGetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Overrides
View SourceNormalize(double, double)
Normalize a latitude and longitude values
Declaration
public static GeoCoordinateBasic Normalize(double latitude, double longitude)
Parameters
| Type | Name | Description |
|---|---|---|
| double | latitude | |
| double | longitude |
Returns
| Type | Description |
|---|---|
| GeoCoordinateBasic | GeoCoordinateBasic coordinate type |
Remarks
The valid range of latitude values is from -90.0 to 90.0 degrees, the valid range of longitude values is from -180.0 to 180.0 degrees
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |
Overrides
View SourceToString(IFormatProvider)
Converts this instance of the GeoCoordinate object to a formatted string specifying culture-specific format information
Declaration
public string ToString(IFormatProvider iFormatProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| IFormatProvider | iFormatProvider | Culture-specific formatting information |
Returns
| Type | Description |
|---|---|
| string | Returns a formatted string containing the GeoCoordinate values |
Remarks
Will default to 15 decimal places for Seconds
ToString(IFormatProvider, int)
Converts this instance of the GeoCoordinate object to a formatted string specifying culture-specific format information
Declaration
public string ToString(IFormatProvider iFormatProvider, int decimalPlaces)
Parameters
| Type | Name | Description |
|---|---|---|
| IFormatProvider | iFormatProvider | Culture-specific formatting information |
| int | decimalPlaces | Number of decimal places for Latitude and Longitude seconds |
Returns
| Type | Description |
|---|---|
| string | Returns a formatted string containing the GeoCoordinate values |
WGS84CrsIntersect(GeoCoordinateBasic, CompassBearing, CompassBearing, ref GeoCoordinateBasic)
Declaration
public bool WGS84CrsIntersect(GeoCoordinateBasic point2, CompassBearing az13, CompassBearing az23, ref GeoCoordinateBasic intersectPoint)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoCoordinateBasic | point2 | |
| CompassBearing | az13 | |
| CompassBearing | az23 | |
| GeoCoordinateBasic | intersectPoint |
Returns
| Type | Description |
|---|---|
| bool |
WGS84Destination(CompassBearing, LinearDistance)
Member to computed the coordinate from a base point translated by Azimuth and a distance
Declaration
public GeoCoordinateBasic WGS84Destination(CompassBearing compassBearing, LinearDistance distance)
Parameters
| Type | Name | Description |
|---|---|---|
| CompassBearing | compassBearing | |
| LinearDistance | distance | The distance along the azimuth |
Returns
| Type | Description |
|---|---|
| GeoCoordinateBasic | Returns basic type coordinate |
Remarks
Uses FAA formulae in calculations
WGS84Distance(GeoCoordinateBasic)
Member to computed the distance between two coordinates
Declaration
public GeoAzimuthDistance WGS84Distance(GeoCoordinateBasic secondGeoPoint)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoCoordinateBasic | secondGeoPoint | Second point |
Returns
| Type | Description |
|---|---|
| GeoAzimuthDistance | Struct containing distance along with forward and reverse azimuths |
Remarks
Uses FAA formulae in calculations
WGS84Distance(GeoCoordinateBasic, GeoCoordinateBasic)
Static method to computed the distance between two coordinates
Declaration
public static GeoAzimuthDistance WGS84Distance(GeoCoordinateBasic firstGeoPoint, GeoCoordinateBasic secondGeoPoint)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoCoordinateBasic | firstGeoPoint | First point |
| GeoCoordinateBasic | secondGeoPoint | Second point |
Returns
| Type | Description |
|---|---|
| GeoAzimuthDistance | Struct containing distance along with forward and reverse azimuths |
Remarks
Uses FAA formulae in calculations
WGS84PtIsOnArc(GeoCoordinateBasic, LinearDistance, CompassBearing, CompassBearing, ArcOrientation, GeoCoordinateBasic, ref bool)
Determine if a geodetic point lies on a geodesic arc
Declaration
public static bool WGS84PtIsOnArc(GeoCoordinateBasic arcCentre, LinearDistance arcRadius, CompassBearing arcStartAzimuth, CompassBearing arcEndAzimuth, GeoCoordinateBasic.ArcOrientation arcDirection, GeoCoordinateBasic pointToTest, ref bool ptIsOnArc)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoCoordinateBasic | arcCentre | Centre of the arc |
| LinearDistance | arcRadius | |
| CompassBearing | arcStartAzimuth | Start of the arc defined as azimuth |
| CompassBearing | arcEndAzimuth | End of the arc defined as azimuth |
| GeoCoordinateBasic.ArcOrientation | arcDirection | Direction of the arc between the two azimuth angles; the orientation |
| GeoCoordinateBasic | pointToTest | Point to test if lies on the arc |
| bool | ptIsOnArc | Set to true if point lies on arc within tolerance otherwise false |
Returns
| Type | Description |
|---|---|
| bool | True if sucessful |
Remarks
Uses FAA formulae in calculations
WGS84PtIsOnGeodesic(GeoCoordinateBasic, GeoCoordinateBasic, GeoCoordinateBasic, GeodesicLengthCodes, ref PtIsOnGeodesicResult)
Determine if a geodetic point is on a geodesic line
Declaration
public static bool WGS84PtIsOnGeodesic(GeoCoordinateBasic pt1, GeoCoordinateBasic pt2, GeoCoordinateBasic pt3, GeoCoordinateBasic.GeodesicLengthCodes lengthCode, ref GeoCoordinateBasic.PtIsOnGeodesicResult result)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoCoordinateBasic | pt1 | First point of geodesic line |
| GeoCoordinateBasic | pt2 | Second point of geodesic line |
| GeoCoordinateBasic | pt3 | Point to test if on geodesic line |
| GeoCoordinateBasic.GeodesicLengthCodes | lengthCode | Specifies extent of line 0: geodesic exists only between geoStart and geoEnd. 1: geodesic extends beyound geoEnd |
| GeoCoordinateBasic.PtIsOnGeodesicResult | result | Point to test if on geodesic line |
Returns
| Type | Description |
|---|---|
| bool | False if problem with calcuation |
Remarks
Uses FAA formulae in calculations
WGS84PtIsOnLocus(Locus, GeoCoordinateBasic, GeoCoordinateBasic, double)
Determine if a geodetic point lies on a locus
Declaration
public static bool WGS84PtIsOnLocus(Locus locus, GeoCoordinateBasic testPt, GeoCoordinateBasic projPt, double dTol)
Parameters
| Type | Name | Description |
|---|---|---|
| Locus | locus | |
| GeoCoordinateBasic | testPt | |
| GeoCoordinateBasic | projPt | |
| double | dTol |
Returns
| Type | Description |
|---|---|
| bool | True if sucessful |
Remarks
Uses FAA formulae in calculations
Operators
View Sourceoperator +(GeoCoordinateBasic, GeoCoordinateBasic)
Operator addition of two GeoCoordinateBasic objects
Declaration
public static GeoCoordinateBasic operator +(GeoCoordinateBasic geoCoordinateBasic1, GeoCoordinateBasic geoCoordinateBasic2)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoCoordinateBasic | geoCoordinateBasic1 | First operand of the addition |
| GeoCoordinateBasic | geoCoordinateBasic2 | Second operand of the addition |
Returns
| Type | Description |
|---|---|
| GeoCoordinateBasic | GeoCoordinateBasic object of addition |
operator ==(GeoCoordinateBasic, GeoCoordinateBasic)
Declaration
public static bool operator ==(GeoCoordinateBasic geoCoordinateBasic1, GeoCoordinateBasic geoCoordinateBasic2)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoCoordinateBasic | geoCoordinateBasic1 | |
| GeoCoordinateBasic | geoCoordinateBasic2 |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(GeoCoordinateBasic, GeoCoordinateBasic)
Declaration
public static bool operator !=(GeoCoordinateBasic geoCoordinateBasic1, GeoCoordinateBasic geoCoordinateBasic2)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoCoordinateBasic | geoCoordinateBasic1 | |
| GeoCoordinateBasic | geoCoordinateBasic2 |
Returns
| Type | Description |
|---|---|
| bool |