Class LinearComponentExtracter
Extracts all the 1-dimensional (LineString) components from a Geometry. For polygonal geometries, this will extract all the component LinearRings. If desired, LinearRings can be forced to be returned as LineStrings.
Implements
Inherited Members
Namespace: NetTopologySuite.Geometries.Utilities
Assembly: NetTopologySuite.dll
Syntax
public class LinearComponentExtracter : IGeometryComponentFilter
Constructors
| Improve this Doc View SourceLinearComponentExtracter(ICollection<Geometry>)
Constructs a LineExtracterFilter with a list in which to store LineStrings found.
Declaration
public LinearComponentExtracter(ICollection<Geometry> lines)
Parameters
Type | Name | Description |
---|---|---|
ICollection<Geometry> | lines |
LinearComponentExtracter(ICollection<Geometry>, Boolean)
Constructs a LineExtracterFilter with a list in which to store LineStrings found.
Declaration
public LinearComponentExtracter(ICollection<Geometry> lines, bool isForcedToLineString)
Parameters
Type | Name | Description |
---|---|---|
ICollection<Geometry> | lines | |
Boolean | isForcedToLineString |
Properties
| Improve this Doc View SourceIsForcedToLineString
Declaration
public bool IsForcedToLineString { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
| Improve this Doc View SourceFilter(Geometry)
Declaration
public void Filter(Geometry geom)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom |
GetGeometry(Geometry)
Extracts the linear components from a single Geometry and returns them as either a LineString or MultiLineString.
Declaration
public static Geometry GetGeometry(Geometry geom)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | The geometry from which to extract |
Returns
Type | Description |
---|---|
Geometry | A linear geometry |
GetGeometry(Geometry, Boolean)
Extracts the linear components from a single Geometry and returns them as either a LineString or MultiLineString.
Declaration
public static Geometry GetGeometry(Geometry geom, bool forceToLineString)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | The geometry from which to extract |
Boolean | forceToLineString |
|
Returns
Type | Description |
---|---|
Geometry | A linear geometry |
GetLines(Geometry)
Extracts the linear components from a single point.
If more than one point is to be processed, it is more
efficient to create a single LineExtracterFilter
instance
and pass it to multiple geometries.
Declaration
public static ReadOnlyCollection<Geometry> GetLines(Geometry geom)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | The point from which to extract linear components. |
Returns
Type | Description |
---|---|
ReadOnlyCollection<Geometry> | The list of linear components. |
GetLines(Geometry, Boolean)
Extracts the linear components from a single geometry. If more than one geometry is to be processed, it is more efficient to create a single LinearComponentExtracter instance and pass it to multiple geometries.
Declaration
public static ReadOnlyCollection<Geometry> GetLines(Geometry geom, bool forceToLineString)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | The geometry from which to extract linear components |
Boolean | forceToLineString |
|
Returns
Type | Description |
---|---|
ReadOnlyCollection<Geometry> | The list of linear components |
GetLines<TCollection>(Geometry, TCollection)
Extracts the linear components from a single Geometry and adds them to the provided ICollection<T>.
Declaration
public static TCollection GetLines<TCollection>(Geometry geom, TCollection lines)
where TCollection : ICollection<Geometry>
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | The geometry from which to extract linear components |
TCollection | lines | The Collection to add the extracted linear components to |
Returns
Type | Description |
---|---|
TCollection | The Collection of linear components (LineStrings or LinearRings) |
Type Parameters
Name | Description |
---|---|
TCollection |
GetLines<TCollection>(Geometry, TCollection, Boolean)
Extracts the linear components from a single Geometry and adds them to the provided ICollection<T>.
Declaration
public static TCollection GetLines<TCollection>(Geometry geom, TCollection lines, bool forceToLineString)
where TCollection : ICollection<Geometry>
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | The geometry from which to extract linear components |
TCollection | lines | The Collection to add the extracted linear components to |
Boolean | forceToLineString |
Returns
Type | Description |
---|---|
TCollection | The Collection of linear components (LineStrings or LinearRings) |
Type Parameters
Name | Description |
---|---|
TCollection |
GetLines<TCollection>(IEnumerable<Geometry>, TCollection)
Extracts the linear components from a IEnumerable<T> and adds them to the provided ICollection<T>.
Declaration
public static TCollection GetLines<TCollection>(IEnumerable<Geometry> geoms, TCollection lines)
where TCollection : ICollection<Geometry>
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Geometry> | geoms | The geometry from which to extract linear components |
TCollection | lines | The Collection to add the extracted linear components to |
Returns
Type | Description |
---|---|
TCollection | The Collection of linear components (LineStrings or LinearRings) |
Type Parameters
Name | Description |
---|---|
TCollection |
GetLines<TCollection>(IEnumerable<Geometry>, TCollection, Boolean)
Extracts the linear components from a IEnumerable<T> and adds them to the provided ICollection<T>.
Declaration
public static TCollection GetLines<TCollection>(IEnumerable<Geometry> geoms, TCollection lines, bool forceToLineString)
where TCollection : ICollection<Geometry>
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Geometry> | geoms | The geometry from which to extract linear components |
TCollection | lines | The Collection to add the extracted linear components to |
Boolean | forceToLineString |
Returns
Type | Description |
---|---|
TCollection | The Collection of linear components (LineStrings or LinearRings) |
Type Parameters
Name | Description |
---|---|
TCollection |