Table of Contents

Class Label

Namespace
NetTopologySuite.GeometriesGraph
Assembly
NetTopologySuite.dll

A Label indicates the topological relationship of a component of a topology graph to a given Geometry. This class supports labels for relationships to two Geometrys, which is sufficient for algorithms for binary operations. Topology graphs support the concept of labeling nodes and edges in the graph. The label of a node or edge specifies its topological relationship to one or more geometries. (In fact, since NTS operations have only two arguments labels are required for only two geometries). A label for a node or edge has one or two elements, depending on whether the node or edge occurs in one or both of the input Geometrys. Elements contain attributes which categorize the topological location of the node or edge relative to the parent Geometry; that is, whether the node or edge is in the interior, boundary or exterior of the Geometry. Attributes have a value from the set {Interior, Boundary, Exterior}. In a node each element has a single attribute On. For an edge each element has a triplet of attributes Left, On, Right. It is up to the client code to associate the 0 and 1 TopologyLocations with specific geometries.

public class Label
Inheritance
Label
Inherited Members

Constructors

Label(Location)

Construct a Label with a single location for both Geometries. Initialize the locations to Null.

public Label(Location onLoc)

Parameters

onLoc Location

A location value

Label(Location, Location, Location)

Construct a Label with On, Left and Right locations for both Geometries. Initialize the locations for both Geometries to the given values.

public Label(Location onLoc, Location leftLoc, Location rightLoc)

Parameters

onLoc Location

A location value for On

leftLoc Location

A location value for Left

rightLoc Location

A location value for Right

Label(Label)

Construct a Label with the same values as the argument Label.

public Label(Label lbl)

Parameters

lbl Label

A Label

Label(int, Location)

Construct a Label with a single location for both Geometries. Initialize the location for the Geometry index.

public Label(int geomIndex, Location onLoc)

Parameters

geomIndex int

A geometry index, 0, or 1.

onLoc Location

A location value for On

Label(int, Location, Location, Location)

Construct a Label with On, Left and Right locations for both Geometries. Initialize the locations for the given Geometry index.

public Label(int geomIndex, Location onLoc, Location leftLoc, Location rightLoc)

Parameters

geomIndex int

A geometry index, 0, or 1.

onLoc Location

A location value for On

leftLoc Location

A location value for Left

rightLoc Location

A location value for Right

Properties

GeometryCount

public int GeometryCount { get; }

Property Value

int

Methods

AllPositionsEqual(int, Location)

public bool AllPositionsEqual(int geomIndex, Location loc)

Parameters

geomIndex int
loc Location

Returns

bool

Flip()

Performs Flip() on both TopologyLocations of this Label

public void Flip()

GetLocation(int)

public Location GetLocation(int geomIndex)

Parameters

geomIndex int

Returns

Location

GetLocation(int, Position)

public Location GetLocation(int geomIndex, Position posIndex)

Parameters

geomIndex int
posIndex Position

Returns

Location

GetLocation(int, Positions)

[Obsolete("Use GetLocation(int, Topology.Location)")]
public Location GetLocation(int geomIndex, Positions posIndex)

Parameters

geomIndex int
posIndex Positions

Returns

Location

IsAnyNull(int)

public bool IsAnyNull(int geomIndex)

Parameters

geomIndex int

Returns

bool

IsArea()

public bool IsArea()

Returns

bool

IsArea(int)

public bool IsArea(int geomIndex)

Parameters

geomIndex int

Returns

bool

IsEqualOnSide(Label, int)

public bool IsEqualOnSide(Label lbl, int side)

Parameters

lbl Label
side int

Returns

bool

IsLine(int)

public bool IsLine(int geomIndex)

Parameters

geomIndex int

Returns

bool

IsNull(int)

public bool IsNull(int geomIndex)

Parameters

geomIndex int

Returns

bool

Merge(Label)

Merge this label with another one. Merging updates any null attributes of this label with the attributes from lbl.

public void Merge(Label lbl)

Parameters

lbl Label

The Label to merge

SetAllLocations(int, Location)

public void SetAllLocations(int geomIndex, Location _location)

Parameters

geomIndex int
_location Location

SetAllLocationsIfNull(Location)

public void SetAllLocationsIfNull(Location _location)

Parameters

_location Location

SetAllLocationsIfNull(int, Location)

public void SetAllLocationsIfNull(int geomIndex, Location _location)

Parameters

geomIndex int
_location Location

SetLocation(int, Location)

public void SetLocation(int geomIndex, Location _location)

Parameters

geomIndex int
_location Location

SetLocation(int, Position, Location)

public void SetLocation(int geomIndex, Position posIndex, Location _location)

Parameters

geomIndex int
posIndex Position
_location Location

SetLocation(int, Positions, Location)

[Obsolete("Use SetLocation(int, Geometries.Position, Location)")]
public void SetLocation(int geomIndex, Positions posIndex, Location _location)

Parameters

geomIndex int
posIndex Positions
_location Location

ToLine(int)

Converts one GeometryLocation to a Line location.

public void ToLine(int geomIndex)

Parameters

geomIndex int

The index of the TopologyLocation to convert (0 or 1)

ToLineLabel(Label)

Converts a Label to a Line label (that is, one with no side Location).

public static Label ToLineLabel(Label label)

Parameters

label Label

Label to convert.

Returns

Label

Label as Line label.

ToString()

public override string ToString()

Returns

string