Search Results for

    Show / Hide Table of Contents

    Class GeometryFixer

    Fixes a geometry to be a valid geometry, while preserving as much as possible of the shape and location of the input. Validity is determined according to IsValid.

    Input geometries are always processed, so even valid inputs may have some minor alterations.The output is always a new geometry object.

    Semantic Rules

    1. Vertices with non-finite X or Y ordinates are removed (as per IsValid)
    2. Repeated points are reduced to a single point
    3. Empty atomic geometries are valid and are returned unchanged
    4. Empty elements are removed from collections
    5. Point: keep valid coordinate, or EMPTY
    6. LineString: coordinates are fixed
    7. LinearRing: coordinates are feixed, keep valid ring or else convert into LineString
    8. Polygon: transform into a valid polygon or multipolygon, preserving as much of the extent and vertices as possible.
      • Rings are fixed to ensure they are valid
      • Holes intersection the shell are subtracted from the shell
      • Holes outside the shell are converted into polygons
    9. MultiPolygon: each polygon is fixed, then result made non - overlapping (via union)
    10. GeometryCollection: each element is fixed
    11. Collapsed lines and polygons are handled as follows, depending on the keepCollapsed setting:
      • false: (default) collapses are converted to empty geometries (and removed if they are elements of collections)
      • true: collapses are converted to a valid geometry of lower dimension
    Inheritance
    object
    GeometryFixer
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: NetTopologySuite.Geometries.Utilities
    Assembly: NetTopologySuite.dll
    Syntax
    public class GeometryFixer

    Constructors

    | Edit this page View Source

    GeometryFixer(Geometry)

    Creates a new instance to fix a given geometry

    Declaration
    public GeometryFixer(Geometry geom)
    Parameters
    Type Name Description
    Geometry geom

    The geometry to be fixed

    Properties

    | Edit this page View Source

    KeepCollapsed

    Gets or sets a value indicating whether collapsed geometries are converted to empty, (which will be removed from collections), or to a valid geometry of lower dimension. The default is to convert collapses to empty geometries (false).

    Declaration
    public bool KeepCollapsed { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    KeepMulti

    Gets or sets a value indicating whether collapsed geometries are converted to empty, (which will be removed from collections), or to a valid geometry of lower dimension. The default is to convert collapses to empty geometries (false).

    Declaration
    public bool KeepMulti { get; set; }
    Property Value
    Type Description
    bool

    Methods

    | Edit this page View Source

    Fix(Geometry)

    Fixes a geometry to be valid.

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

    The geometry to be fixed

    Returns
    Type Description
    Geometry

    The valid fixed geometry

    | Edit this page View Source

    Fix(Geometry, bool)

    Fixes a geometry to be valid, allowing to set a flag controlling how single item results from fixed MULTI geometries should be returned.

    Declaration
    public static Geometry Fix(Geometry geom, bool isKeepMulti)
    Parameters
    Type Name Description
    Geometry geom

    The geometry to be fixed

    bool isKeepMulti

    A flag indicating if MULTI geometries should not be converted to single instance types if they consist of only one item.

    Returns
    Type Description
    Geometry

    The valid fixed geometry

    | Edit this page View Source

    GetResult()

    Gets the fixed geometry.

    Declaration
    public Geometry GetResult()
    Returns
    Type Description
    Geometry

    The fixed geometry

    See Also

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