Search Results for

    Show / Hide Table of Contents

    Class InteriorPointArea

    Computes a point in the interior of an areal geometry. The point will lie in the geometry interior in all except certain pathological cases.

    Inheritance
    object
    InteriorPointArea
    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 InteriorPointArea
    Remarks

    Algorithm:

    For each input polygon:
    • Determine a horizontal scan line on which the interior point will be located. To increase the chance of the scan line having non-zero-width intersection with the polygon the scan line Y ordinate is chosen to be near the centre of the polygon's Y extent but distinct from all of vertex Y ordinates.
    • Compute the sections of the scan line which lie in the interior of the polygon.
    • Choose the widest interior section and take its midpoint as the interior point.
    The final interior point is chosen as the one occurring in the widest interior section.

    This algorithm is a tradeoff between performance and point quality (where points further from the geometry boundary are considered to be higher quality) Priority is given to performance. This means that the computed interior point may not be suitable for some uses (such as label positioning).

    The algorithm handles some kinds of invalid/degenerate geometry, including zero-area and self-intersecting polygons.

    Empty geometry is handled by returning a null point.

    KNOWN BUGS

    • If a fixed precision model is used, in some cases this method may return a point which does not lie in the interior.
    • If the input polygon is extremely narrow the computed point may not lie in the interior of the polygon.

    Constructors

    | Edit this page View Source

    InteriorPointArea(Geometry)

    Creates a new interior point finder for an areal geometry.

    Declaration
    public InteriorPointArea(Geometry g)
    Parameters
    Type Name Description
    Geometry g

    An areal geometry

    Properties

    | Edit this page View Source

    InteriorPoint

    Gets the computed interior point or null if the input geometry is empty.

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

    Methods

    | Edit this page View Source

    GetInteriorPoint(Geometry)

    Computes an interior point for the polygonal components of a Geometry.

    Declaration
    public static Coordinate GetInteriorPoint(Geometry geom)
    Parameters
    Type Name Description
    Geometry geom

    The geometry to compute.

    Returns
    Type Description
    Coordinate

    The computed interior point, or null if the geometry has no polygonal components.

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