Click or drag to resize

LatLon Structure

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Latitude Longitude Pair, expressed in degrees (WGS84 World Geodetic System projection).

Namespace:  Telogis.GeoBase
Assembly:  geobase.net (in geobase.net.dll) Version: 4.99.0.0
Syntax
[SerializableAttribute]
[TypeConverterAttribute(typeof(LatLonStringConverter))]
public struct LatLon

The LatLon type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleLatLon(LatLon)
Create a copy of a LatLon.
Public methodCode exampleLatLon(String)
Takes a string of form "latitude,longitude" and creates a LatLon object.
Public methodCode exampleLatLon(UInt64)
Initialize from 64bit integer. See AsInt64.
Public methodLatLon(XmlNode)

Construct a new LatLon from an XML node.

As of 4.3: Retrieving the 'Location' attribute if it is present.

Pre 4.3: Retrieving the old attributes "Lat" and "Lon".

Public methodLatLon(Double, Double)
Initialize from parameters.
Public methodLatLon(Double, Double, UInt32)
Initializes a LatLon object with a latitude, longitude, and z-level.
Top
Properties
  NameDescription
Public propertyCode exampleAsInt64
Return Latitude and Longitude packed as a 64bit integer.
Public propertyCode exampleIsValid
True only if this LatLon has been assigned a valid value.
Public propertyLat
Latitude (Y) in degrees.
Public propertyLon
Longitude (X) in degrees.
Public propertyWKT
Return this point formatted for WKT (Well Known Text).
Public propertyWKTWithZ
Return this point formatted for WKT (Well Known Text) with Z level.
Public propertyCode examplex
Gets or sets Lon.
Public propertyCode exampley
Gets or sets Lat.
Public propertyZLevel
Gets or sets the z-level of this LatLon. It is used to determine whether there is a height difference between overlapping LatLons, for example when one road crosses another road as a bridge.
Top
Methods
  NameDescription
Public methodDistanceTo

Measure distance between this and another LatLon (using GreatCircle(Double, Double, Double, Double)) in the specified units.

May have error of up to ~16 cm at equator (less, the further away from the equator the points are)

Public methodCode exampleEquals
Check for equality with another LatLon by checking if they occupy the same coordinates.
(Overrides ValueTypeEquals(Object).)
Public methodStatic memberFromParts
Create a LatLon from position parameters.
Public methodGetHashCode
Create a hash code for this LatLon.
(Overrides ValueTypeGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIsWithin
Check whether this LatLon lies within a box defined by the minimum and maximum LatLons. See remarks.
Public methodPythagoreanDistanceTo Obsolete.
This method is obsolete. Please use QuickDistanceTo(LatLon, DistanceUnit) instead.
Public methodCode exampleQuickDistanceTo
Measure approximate distance between this and another LatLon (using a Pythagorean approximation). See remarks for comments on the accuracy of this method.
Public methodCode exampleToString
Returns the coordinates of this LatLon in the form "Lat,Lon".
(Overrides ValueTypeToString.)
Public methodToStringWithZ
Returns the coordinates of this LatLon in the form "Lat,Lon,Z". If ZLevel is 0 then the ZLevel is omitted.
Public methodToXmlString
Return the LatLon in it's String With Z form Location="0.000000,0.000000 Z0".
Top
Operators
  NameDescription
Public operatorStatic memberEquality
Checks two LatLons for equality.
Public operatorStatic memberInequality
Checks two LatLons for inequality.
Top
Fields
  NameDescription
Public fieldStatic memberEmpty
An empty (null-equivalent) LatLon.
Top
Extension Methods
  NameDescription
Public Extension MethodToLatLng (Defined by Convert.)
Top
Remarks
GeoBase works with the WGS84 World Geodetic System. If your data is in a different projection you will need to reproject the points to work with them in GeoBase. For more information on WGS84 click here (PDF file).

Related articles: Common Concepts, Geocoding Concept, Map Control Tutorial, Creating a Route, Routing with Traffic.

See Also