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 Geometry
s,
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 Geometry
s. 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 TopologyLocation
s
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
LocationA 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
LocationA location value for On
leftLoc
LocationA location value for Left
rightLoc
LocationA location value for Right
Label(Label)
Construct a Label with the same values as the argument Label.
public Label(Label lbl)
Parameters
lbl
LabelA
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
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
intA geometry index,
0
, or1
.onLoc
LocationA location value for On
leftLoc
LocationA location value for Left
rightLoc
LocationA location value for Right
Properties
GeometryCount
public int GeometryCount { get; }
Property Value
Methods
AllPositionsEqual(int, Location)
public bool AllPositionsEqual(int geomIndex, Location loc)
Parameters
Returns
Flip()
Performs Flip() on both
TopologyLocations of this Label
public void Flip()
GetLocation(int)
public Location GetLocation(int geomIndex)
Parameters
geomIndex
int
Returns
GetLocation(int, Position)
public Location GetLocation(int geomIndex, Position posIndex)
Parameters
Returns
GetLocation(int, Positions)
[Obsolete("Use GetLocation(int, Topology.Location)")]
public Location GetLocation(int geomIndex, Positions posIndex)
Parameters
Returns
IsAnyNull(int)
public bool IsAnyNull(int geomIndex)
Parameters
geomIndex
int
Returns
IsArea()
public bool IsArea()
Returns
IsArea(int)
public bool IsArea(int geomIndex)
Parameters
geomIndex
int
Returns
IsEqualOnSide(Label, int)
public bool IsEqualOnSide(Label lbl, int side)
Parameters
Returns
IsLine(int)
public bool IsLine(int geomIndex)
Parameters
geomIndex
int
Returns
IsNull(int)
public bool IsNull(int geomIndex)
Parameters
geomIndex
int
Returns
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
LabelThe
Label
to merge
SetAllLocations(int, Location)
public void SetAllLocations(int geomIndex, Location _location)
Parameters
SetAllLocationsIfNull(Location)
public void SetAllLocationsIfNull(Location _location)
Parameters
_location
Location
SetAllLocationsIfNull(int, Location)
public void SetAllLocationsIfNull(int geomIndex, Location _location)
Parameters
SetLocation(int, Location)
public void SetLocation(int geomIndex, Location _location)
Parameters
SetLocation(int, Position, Location)
public void SetLocation(int geomIndex, Position posIndex, Location _location)
Parameters
SetLocation(int, Positions, Location)
[Obsolete("Use SetLocation(int, Geometries.Position, Location)")]
public void SetLocation(int geomIndex, Positions posIndex, Location _location)
Parameters
ToLine(int)
Converts one GeometryLocation to a Line location.
public void ToLine(int geomIndex)
Parameters
geomIndex
intThe index of the
TopologyLocation
to convert (0
or1
)
ToLineLabel(Label)
Converts a Label to a Line label (that is, one with no side Location).
public static Label ToLineLabel(Label label)
Parameters
label
LabelLabel to convert.
Returns
- Label
Label as Line label.
ToString()
public override string ToString()