Search Results for

    Show / Hide Table of Contents

    Class MinimumDiameter

    Computes the minimum diameter of a Geometry.

    Inheritance
    object
    MinimumDiameter
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: NetTopologySuite.Algorithm
    Assembly: NetTopologySuite.dll
    Syntax
    public class MinimumDiameter
    Remarks

    The minimum diameter is defined to be the width of the smallest band that contains the geometry, where a band is a strip of the plane defined by two parallel lines. This can be thought of as the smallest hole that the point can be moved through, with a single rotation.

    The first step in the algorithm is computing the convex hull of the Geometry. If the input Geometry is known to be convex, a hint can be supplied to avoid this computation.

    This class can also be used to compute

    • a line segment representing the minimum diameter
    • the supporting line segment of the minimum diameter
    • a minimum-width rectangle of the input geometry. The rectangle has width equal to the minimum diameter, and has one side parallel to the supporting segment. In degenerate cases the rectangle may be a LineString or a Point. (Note that this may not be the enclosing rectangle with minimum area; use MinimumAreaRectangle to compute this.)

    Constructors

    | Edit this page View Source

    MinimumDiameter(Geometry)

    Compute a minimum diameter for a given Geometry.

    Declaration
    public MinimumDiameter(Geometry inputGeom)
    Parameters
    Type Name Description
    Geometry inputGeom

    a Geometry.

    | Edit this page View Source

    MinimumDiameter(Geometry, bool)

    Compute a minimum diameter for a giver Geometry, with a hint if the Geometry is convex (e.g. a convex Polygon or LinearRing, or a two-point LineString, or a Point).

    Declaration
    public MinimumDiameter(Geometry inputGeom, bool isConvex)
    Parameters
    Type Name Description
    Geometry inputGeom

    a Geometry which is convex.

    bool isConvex

    true if the input point is convex.

    Properties

    | Edit this page View Source

    Diameter

    Gets a LineString which is a minimum diameter.

    Declaration
    public LineString Diameter { get; }
    Property Value
    Type Description
    LineString

    A LineString which is a minimum diameter.

    | Edit this page View Source

    Length

    Gets the length of the minimum diameter of the input Geometry.

    Declaration
    public double Length { get; }
    Property Value
    Type Description
    double

    The length of the minimum diameter.

    | Edit this page View Source

    SupportingSegment

    Gets the segment forming the base of the minimum diameter.

    Declaration
    public LineString SupportingSegment { get; }
    Property Value
    Type Description
    LineString

    The segment forming the base of the minimum diameter.

    | Edit this page View Source

    WidthCoordinate

    Gets the Coordinate forming one end of the minimum diameter.

    Declaration
    public Coordinate WidthCoordinate { get; }
    Property Value
    Type Description
    Coordinate

    A coordinate forming one end of the minimum diameter.

    Methods

    | Edit this page View Source

    GetMinimumDiameter(Geometry)

    Gets the minimum diameter enclosing a geometry.

    Declaration
    public static Geometry GetMinimumDiameter(Geometry geom)
    Parameters
    Type Name Description
    Geometry geom

    The geometry

    Returns
    Type Description
    Geometry

    The length of the minimum diameter of the geometry

    | Edit this page View Source

    GetMinimumRectangle()

    Gets the rectangular Polygon which encloses the input geometry and is based on the minimum diameter supporting segment.

    Declaration
    public Geometry GetMinimumRectangle()
    Returns
    Type Description
    Geometry

    A rectangle enclosing the input (or a line or point if degenerate)

    Remarks

    The rectangle has width equal to the minimum diameter, and a longer length. If the convex hull of the input is degenerate (a line or point) a LineString or Point is returned.

    This is not necessarily the enclosing rectangle with minimum area.

    See Also
    MinimumAreaRectangle
    | Edit this page View Source

    GetMinimumRectangle(Geometry)

    Gets the minimum-width rectangular Polygon which encloses the input geometry and is based along the supporting segment. The rectangle has width equal to the minimum diameter, and a longer length. If the convex hull of the input is degenerate (a line or point) a LineString or Point is returned.

    This is not necessarily the rectangle with minimum area. Use MinimumAreaRectangle to compute this.
    Declaration
    public static Geometry GetMinimumRectangle(Geometry geom)
    Parameters
    Type Name Description
    Geometry geom

    The geometry

    Returns
    Type Description
    Geometry

    The minimum-width rectangle enclosing the geometry

    See Also
    MinimumAreaRectangle

    See Also

    ConvexHull
    MinimumAreaRectangle
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX