Table of Contents

Class LinearComponentExtracter

Namespace
NetTopologySuite.Geometries.Utilities
Assembly
NetTopologySuite.dll

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.

public class LinearComponentExtracter : IGeometryComponentFilter
Inheritance
LinearComponentExtracter
Implements
Inherited Members

Constructors

LinearComponentExtracter(ICollection<Geometry>)

Constructs a LineExtracterFilter with a list in which to store LineStrings found.

public LinearComponentExtracter(ICollection<Geometry> lines)

Parameters

lines ICollection<Geometry>

LinearComponentExtracter(ICollection<Geometry>, bool)

Constructs a LineExtracterFilter with a list in which to store LineStrings found.

public LinearComponentExtracter(ICollection<Geometry> lines, bool isForcedToLineString)

Parameters

lines ICollection<Geometry>
isForcedToLineString bool

Properties

IsForcedToLineString

public bool IsForcedToLineString { get; set; }

Property Value

bool

Methods

Filter(Geometry)

public void Filter(Geometry geom)

Parameters

geom Geometry

GetGeometry(Geometry)

Extracts the linear components from a single Geometry and returns them as either a LineString or MultiLineString.

public static Geometry GetGeometry(Geometry geom)

Parameters

geom Geometry

The geometry from which to extract

Returns

Geometry

A linear geometry

GetGeometry(Geometry, bool)

Extracts the linear components from a single Geometry and returns them as either a LineString or MultiLineString.

public static Geometry GetGeometry(Geometry geom, bool forceToLineString)

Parameters

geom Geometry

The geometry from which to extract

forceToLineString bool

true if LinearRings should be converted to LineStrings

Returns

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.

public static ReadOnlyCollection<Geometry> GetLines(Geometry geom)

Parameters

geom Geometry

The point from which to extract linear components.

Returns

ReadOnlyCollection<Geometry>

The list of linear components.

GetLines(Geometry, bool)

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.

public static ReadOnlyCollection<Geometry> GetLines(Geometry geom, bool forceToLineString)

Parameters

geom Geometry

The geometry from which to extract linear components

forceToLineString bool

true if LinearRings should be converted to LineStrings

Returns

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>.

public static TCollection GetLines<TCollection>(Geometry geom, TCollection lines) where TCollection : ICollection<Geometry>

Parameters

geom Geometry

The geometry from which to extract linear components

lines TCollection

The Collection to add the extracted linear components to

Returns

TCollection

The Collection of linear components (LineStrings or LinearRings)

Type Parameters

TCollection

GetLines<TCollection>(Geometry, TCollection, bool)

Extracts the linear components from a single Geometry and adds them to the provided ICollection<T>.

public static TCollection GetLines<TCollection>(Geometry geom, TCollection lines, bool forceToLineString) where TCollection : ICollection<Geometry>

Parameters

geom Geometry

The geometry from which to extract linear components

lines TCollection

The Collection to add the extracted linear components to

forceToLineString bool

Returns

TCollection

The Collection of linear components (LineStrings or LinearRings)

Type Parameters

TCollection

GetLines<TCollection>(IEnumerable<Geometry>, TCollection)

Extracts the linear components from a IEnumerable<T> and adds them to the provided ICollection<T>.

public static TCollection GetLines<TCollection>(IEnumerable<Geometry> geoms, TCollection lines) where TCollection : ICollection<Geometry>

Parameters

geoms IEnumerable<Geometry>

The geometry from which to extract linear components

lines TCollection

The Collection to add the extracted linear components to

Returns

TCollection

The Collection of linear components (LineStrings or LinearRings)

Type Parameters

TCollection

GetLines<TCollection>(IEnumerable<Geometry>, TCollection, bool)

Extracts the linear components from a IEnumerable<T> and adds them to the provided ICollection<T>.

public static TCollection GetLines<TCollection>(IEnumerable<Geometry> geoms, TCollection lines, bool forceToLineString) where TCollection : ICollection<Geometry>

Parameters

geoms IEnumerable<Geometry>

The geometry from which to extract linear components

lines TCollection

The Collection to add the extracted linear components to

forceToLineString bool

Returns

TCollection

The Collection of linear components (LineStrings or LinearRings)

Type Parameters

TCollection