Class Position
A GeoJSON position specified by longitude and latitude.
Inheritance
System.Object
Position
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Elements.GeoJSON
Assembly: Hypar.Elements.dll
Syntax
[JsonConverter(typeof(PositionConverter))]
public class Position
Constructors
Position(Double, Double)
Construct a position.
Declaration
[JsonConstructor]
public Position(double latitude, double longitude)
Parameters
Type | Name | Description |
---|---|---|
System.Double | latitude | The latitude. |
System.Double | longitude | The longitude. |
Properties
Latitude
The latitude in decimal degrees.
Declaration
[JsonProperty("latitude", Required = Required.Always)]
public double Latitude { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Longitude
The longitude in decimal degrees.
Declaration
[JsonProperty("longitude", Required = Required.Always)]
public double Longitude { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
System.Object.Equals(System.Object)
FromVectorMeters(Position, Vector3)
Convert the position to a vector in meters relative to an origin position.
Declaration
public static Position FromVectorMeters(Position relativeToOrigin, Vector3 location)
Parameters
Type | Name | Description |
---|---|---|
Position | relativeToOrigin | A position marking the latitude and longitude of (0,0) |
Vector3 | location | The position to convert to latitude and longitude. |
Returns
Type | Description |
---|---|
Position |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
System.Object.GetHashCode()
ToVectorMeters(Position)
Convert the position to a vector in meters relative to an origin position.
Declaration
public Vector3 ToVectorMeters(Position relativeToOrigin)
Parameters
Type | Name | Description |
---|---|---|
Position | relativeToOrigin | A position marking the latitude and longitude of (0,0) |
Returns
Type | Description |
---|---|
Vector3 |