Table of Contents

Class NodingIntersectionFinder

Namespace
NetTopologySuite.Noding
Assembly
NetTopologySuite.dll

Finds non-noded intersections in a set of {@link SegmentString}s, if any exist.

Non-noded intersections include:

The finder can be limited to finding only interior intersections by setting InteriorIntersectionsOnly.

By default only the first intersection is found, but all can be found by setting FindAllIntersections.
public class NodingIntersectionFinder : ISegmentIntersector
Inheritance
NodingIntersectionFinder
Implements
Inherited Members

Constructors

NodingIntersectionFinder(LineIntersector)

Creates an intersection finder which finds an interior intersection if one exists

public NodingIntersectionFinder(LineIntersector li)

Parameters

li LineIntersector

the LineIntersector to use

Properties

CheckEndSegmentsOnly

Gets/Sets whether only end segments should be tested for intersection. This is a performance optimization that may be used if the segments have been previously noded by an appropriate algorithm. It may be known that any potential noding failures will occur only in end segments.

public bool CheckEndSegmentsOnly { get; set; }

Property Value

bool

Count

Gets the count of intersections found.

public int Count { get; }

Property Value

int

The intersection count.

FindAllIntersections

Gets/Sets whether all intersections should be computed. When this is false (the default value), the value of IsDone is true after the first intersection is found. Default is false.

public bool FindAllIntersections { get; set; }

Property Value

bool

HasIntersection

Tests whether an intersection was found.

public bool HasIntersection { get; }

Property Value

bool

InteriorIntersection

Gets the computed location of the intersection. Due to round-off, the location may not be exact.

[Obsolete("Renamed to just Intersection")]
public Coordinate InteriorIntersection { get; }

Property Value

Coordinate

InteriorIntersectionsOnly

Gets or sets a value indicating whether only interior (proper) intersections will be found.

public bool InteriorIntersectionsOnly { get; set; }

Property Value

bool

Intersection

Gets the computed location of the intersection. Due to round-off, the location may not be exact.

public Coordinate Intersection { get; }

Property Value

Coordinate

IntersectionSegments

Gets the endpoints of the intersecting segments.

public Coordinate[] IntersectionSegments { get; }

Property Value

Coordinate[]

Intersections

Gets the intersections found.

public ReadOnlyCollection<Coordinate> Intersections { get; }

Property Value

ReadOnlyCollection<Coordinate>

A list of Coordinate.

IsDone

public bool IsDone { get; }

Property Value

bool

KeepIntersections

Gets/Sets whether intersection points are recorded. If the only need is to count intersection points, this can be set to false. Default is true.

public bool KeepIntersections { get; set; }

Property Value

bool

Methods

CreateAllIntersectionsFinder(LineIntersector)

Creates a finder which tests if there is at least one intersection. The intersections are recorded for later inspection.

public static NodingIntersectionFinder CreateAllIntersectionsFinder(LineIntersector li)

Parameters

li LineIntersector

A line intersector.

Returns

NodingIntersectionFinder

A finder which finds all intersections.

CreateAnyIntersectionFinder(LineIntersector)

Creates a finder which tests if there is at least one intersection. Uses short-circuiting for efficient performance. The intersection found is recorded.

public static NodingIntersectionFinder CreateAnyIntersectionFinder(LineIntersector li)

Parameters

li LineIntersector

A line intersector.

Returns

NodingIntersectionFinder

A finder which tests if there is at least one intersection.

CreateInteriorIntersectionCounter(LineIntersector)

Creates a finder which counts all interior intersections. The intersections are note recorded to reduce memory usage.

public static NodingIntersectionFinder CreateInteriorIntersectionCounter(LineIntersector li)

Parameters

li LineIntersector

A line intersector.

Returns

NodingIntersectionFinder

A finder which counts all interior intersections.

CreateInteriorIntersectionsFinder(LineIntersector)

Creates a finder which finds all interior intersections. The intersections are recorded for later inspection.

public static NodingIntersectionFinder CreateInteriorIntersectionsFinder(LineIntersector li)

Parameters

li LineIntersector

A line intersector

Returns

NodingIntersectionFinder

A finder which finds all interior intersections.

CreateIntersectionCounter(LineIntersector)

Creates a finder which counts all intersections. The intersections are note recorded to reduce memory usage.

public static NodingIntersectionFinder CreateIntersectionCounter(LineIntersector li)

Parameters

li LineIntersector

A line intersector.

Returns

NodingIntersectionFinder

A finder which counts all intersections.

ProcessIntersections(ISegmentString, int, ISegmentString, int)

This method is called by clients of the ISegmentIntersector class to process intersections for two segments of the ISegmentStrings being intersected.
Note that some clients (such as MonotoneChains) may optimize away this call for segment pairs which they have determined do not intersect (e.g. by an disjoint envelope test).

public void ProcessIntersections(ISegmentString e0, int segIndex0, ISegmentString e1, int segIndex1)

Parameters

e0 ISegmentString
segIndex0 int
e1 ISegmentString
segIndex1 int