Show / Hide Table of Contents

Struct GeoCoordinateBasic

Basic minimal handling of a geographical coordinate in decimal latitude and longitude format

Implements
IEquatable<GeoCoordinateBasic>
Namespace: FpAssistantCore.Geographical
Assembly: FpAssistantCoreScl.dll
Syntax
public struct GeoCoordinateBasic
Remarks

No error checking or validation; cut down for speed and saving memory

Constructors

GeoCoordinateBasic(Double, Double)

Basic constructor

Declaration
public GeoCoordinateBasic(double latitude, double longitude)
Parameters
Type Name Description
System.Double latitude
System.Double longitude
Remarks

Basic checking or validation so pass through GeoCoordinate constructor and return GeoCoordinateBasic; see example

Examples
GeoCoordinateBasic geoCoordinateBasic = new GeoCoordinate(latitude, longitude).GeoCoordinateBasic;

Properties

Latitude

The latitude of the geographic position (Latitude in decimal DMS)

Declaration
public double Latitude { get; set; }
Property Value
Type Description
System.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
System.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

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
System.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
System.Boolean

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Boolean

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

Normalize(Double, Double)

Normalize a latitude and longitude values

Declaration
public static GeoCoordinateBasic Normalize(double latitude, double longitude)
Parameters
Type Name Description
System.Double latitude
System.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

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
System.Boolean

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, GeoCoordinateBasic.ArcOrientation, GeoCoordinateBasic, ref Boolean)

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

System.Boolean ptIsOnArc

Set to true if point lies on arc within tolerance otherwise false

Returns
Type Description
System.Boolean

True if sucessful

Remarks

Uses FAA formulae in calculations

WGS84PtIsOnGeodesic(GeoCoordinateBasic, GeoCoordinateBasic, GeoCoordinateBasic, GeoCoordinateBasic.GeodesicLengthCodes, ref GeoCoordinateBasic.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
System.Boolean

False if problem with calcuation

Remarks

Uses FAA formulae in calculations

Operators

Equality(GeoCoordinateBasic, GeoCoordinateBasic)

Declaration
public static bool operator ==(GeoCoordinateBasic geoCoordinateBasic1, GeoCoordinateBasic geoCoordinateBasic2)
Parameters
Type Name Description
GeoCoordinateBasic geoCoordinateBasic1
GeoCoordinateBasic geoCoordinateBasic2
Returns
Type Description
System.Boolean

Inequality(GeoCoordinateBasic, GeoCoordinateBasic)

Declaration
public static bool operator !=(GeoCoordinateBasic geoCoordinateBasic1, GeoCoordinateBasic geoCoordinateBasic2)
Parameters
Type Name Description
GeoCoordinateBasic geoCoordinateBasic1
GeoCoordinateBasic geoCoordinateBasic2
Returns
Type Description
System.Boolean

Implements

IEquatable<>
In This Article
Back to top Copyright 2018-2023 CADology Limited