GetLine()

Summary

Gets the coordinates that describe the location of a line feature.

Syntax

pts = GetLine(integer id)

Argument Contents
id The ID of the line feature

Returns

An array of coordinates in their topological order. The from node is the first coordinate and the to node is the last coordinate in the array.

Notes

  • The current layer must be a line layer.

  • Some types of layers, such as Esri Shapefiles, can have lines with multiple parts. GetLine() indicates this with the NonUnique error. Use GetMultiLine() to get the coordinates for lines from layers of these types.

Example

pts = GetLine(123)
dist = 0
for i = 1 to pts.length - 1 do
dist = dist + GetDistance(pts[i], pts[i + 1])
end
ShowMessage("The length of the line is " + String(dist))

Error Codes

Error Type Meaning
NotFound No line feature exists with the given ID
NonUnique More than one line feature exists with the given ID

See Also

Function Summary
GetArea() Get the coordinates that describe an area feature
GetFeatureLength() Returns the length of the feature in current map units
GetMultiLine() Gets the coordinates that describe the location of a multiple part line feature
GetPoint() Gets the location of the point feature with the specified ID
ReshapeLink() Changes the coordinates of a line feature in a standard geographic file