Click or drag to resize

LineStringLineLength Method

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Calculate the length of this LineString in the specified DistanceUnits.

Namespace:  Telogis.GeoBase.Geometry
Assembly:  geobase.net (in geobase.net.dll) Version: 4.99.0.0
Syntax
public double LineLength(
	DistanceUnit unit
)

Parameters

unit
Type: Telogis.GeoBaseDistanceUnit
The unit of distance to be used.

Return Value

Type: Double
Length of the LineString in the given units
Examples
C#
// Create a LineString from an array of four points
Telogis.GeoBase.Geometry.LineString newLine = new Telogis.GeoBase.Geometry.LineString(
    new Telogis.GeoBase.LatLon[] {
            new Telogis.GeoBase.LatLon(33.594096,-117.741204),
            new Telogis.GeoBase.LatLon(33.594195,-117.726176),
            new Telogis.GeoBase.LatLon(33.582902,-117.725361),
            new Telogis.GeoBase.LatLon(33.582953,-117.740873)}
);
// Length of the LineString in miles
Double lineDist = newLine.LineLength(DistanceUnit.MILES);
// 2.5419918179557 miles
See Also