Class GeoLine
Handling of a geographical line (geo-line) defined by a start and end GeoCoordinate
Implements
Inherited Members
Namespace: FpAssistantCore.Geographical
Assembly: FpAssistantCoreScl.dll
Syntax
public class GeoLine : GeoMapElement, IGeoMapElement
Constructors
View SourceGeoLine(GeoCoordinate, GeoCoordinate)
Constructor to initalise with two coordinates to define a geographical line
Declaration
public GeoLine(GeoCoordinate startCoordinate, GeoCoordinate endCoordinate)
Parameters
Type | Name | Description |
---|---|---|
GeoCoordinate | startCoordinate | geographical coordinate of the start of the line |
GeoCoordinate | endCoordinate | geographical coordinate of the end of the line |
GeoLine(GeoCoordinate, GeoCoordinate, LinearDistance, LinearDistance, MapObjectProperties)
Constructor to initalise with two coordinates to define a geographical line with elevations
Declaration
public GeoLine(GeoCoordinate startCoordinate, GeoCoordinate endCoordinate, LinearDistance startElevation, LinearDistance endElevation, MapObjectProperties mapObjectProperties)
Parameters
Type | Name | Description |
---|---|---|
GeoCoordinate | startCoordinate | geographical coordinate of the start of the line |
GeoCoordinate | endCoordinate | geographical coordinate of the end of the line |
LinearDistance | startElevation | Distance for the elevation of the start point |
LinearDistance | endElevation | Distance for the elevation of the end point |
MapObjectProperties | mapObjectProperties | Default values of map element properties, NULL can be passed |
GeoLine(GeoCoordinate, GeoCoordinate, MapObjectProperties)
Constructor to initalise with two coordinates to define a geographical line
Declaration
public GeoLine(GeoCoordinate startCoordinate, GeoCoordinate endCoordinate, MapObjectProperties mapObjectProperties)
Parameters
Type | Name | Description |
---|---|---|
GeoCoordinate | startCoordinate | geographical coordinate of the start of the line |
GeoCoordinate | endCoordinate | geographical coordinate of the end of the line |
MapObjectProperties | mapObjectProperties | Default values of map element properties, NULL can be passed |
GeoLine(GeoCoordinateElevation, GeoCoordinateElevation)
Constructor to initalise with two coordinates to define a geographical line with elevations
Declaration
public GeoLine(GeoCoordinateElevation startCoordinate, GeoCoordinateElevation endCoordinate)
Parameters
Type | Name | Description |
---|---|---|
GeoCoordinateElevation | startCoordinate | geographical coordinate of the start of the line with elevation |
GeoCoordinateElevation | endCoordinate | geographical coordinate of the end of the line with elevation |
Properties
View SourceDistance
Property to access the distance of the geographical line
Declaration
public LinearDistance Distance { get; }
Property Value
Type | Description |
---|---|
LinearDistance | Geodectic distance of the line |
Remarks
This calculation will ignore any elevation values assign to this object
EndCoordinate
Access to the end coordinate of the geoline object
Declaration
public GeoCoordinate EndCoordinate { get; set; }
Property Value
Type | Description |
---|---|
GeoCoordinate | End coordinate of the geo-line |
EndElevation
Access to the end coordinates elevation
Declaration
public LinearDistance EndElevation { get; set; }
Property Value
Type | Description |
---|---|
LinearDistance | Elevation of the end coordinate |
ForwardAzimuth
Forward azimuth value of the GeoLine object
Declaration
public CompassBearing ForwardAzimuth { get; }
Property Value
Type | Description |
---|---|
CompassBearing | Angle of the forward azimuth |
Remarks
The line direction is from the StartCoordinate to the EndCoordinate
ReverseAzimuth
Reverse azimuth value of the GeoLine object
Declaration
public CompassBearing ReverseAzimuth { get; }
Property Value
Type | Description |
---|---|
CompassBearing | Angle of the reverse azimuth |
Remarks
The line direction is from the StartCoordinate to the EndCoordinate
StartCoordinate
Access to the first coordinate of the geoline object
Declaration
public GeoCoordinate StartCoordinate { get; set; }
Property Value
Type | Description |
---|---|
GeoCoordinate | Start coordinate of the geo-line |
StartElevation
Access to the first coordinates elevation, start point
Declaration
public LinearDistance StartElevation { get; set; }
Property Value
Type | Description |
---|---|
LinearDistance | Elevation of the first coordinate |
Methods
View SourceAsGeography(IFormatProvider)
Creates a geography type LINESTRING()
Declaration
public string AsGeography(IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
IFormatProvider | provider | Globalization culture to be applied to numbers |
Returns
Type | Description |
---|---|
System.String | String of the geography |
Remarks
LINESTRING( StartLongitude StartLatitude, EndLongitude EndLatitude) / LINESTRING(-122.360 47.656, -122.343 47.656) - Altitude is in metres and the measure is set to 0
AsGmlPosList(GmlDimension, IFormatProvider)
Creates a value for GML posList element
Declaration
public string AsGmlPosList(GmlDimension gmlDimension, IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
GmlDimension | gmlDimension | Determine if the GML output is required to be 2D or 3D coordinate values |
IFormatProvider | provider | Globalization culture to be applied to numbers |
Returns
Type | Description |
---|---|
System.String | String of the GML PosList element value |
Intersection(GeoLine, ref GeoCoordinate)
Computes the intersection, if any, of two GeoLine objects on a sphere
Declaration
public bool Intersection(GeoLine geoLine2, ref GeoCoordinate intersectionCoordinate)
Parameters
Type | Name | Description |
---|---|---|
GeoLine | geoLine2 | Second GeoLine used to compute any intersections |
GeoCoordinate | intersectionCoordinate | By reference, the computed intersection |
Returns
Type | Description |
---|---|
System.Boolean | True is successfull, otherwise false |
Remarks
Parameter geoLine2 must not be null, otherwise ArgumentNullException will be thrown