Search Results for

    Show / Hide Table of Contents

    Class Envelope

    Defines a rectangular region of the 2D coordinate plane.

    Inheritance
    object
    Envelope
    Implements
    IComparable<Envelope>
    IIntersectable<Envelope>
    IExpandable<Envelope>
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: NetTopologySuite.Geometries
    Assembly: NetTopologySuite.dll
    Syntax
    [Serializable]
    public class Envelope : IComparable<Envelope>, IIntersectable<Envelope>, IExpandable<Envelope>
    Remarks

    It is often used to represent the bounding box of a Geometry, e.g. the minimum and maximum x and y values of the Coordinates. Note that Envelopes support infinite or half-infinite regions, by using the values of Double.PositiveInfinity and Double.NegativeInfinity. When Envelope objects are created or initialized, the supplied extent values are automatically sorted into the correct order.

    Constructors

    | Edit this page View Source

    Envelope()

    Creates a null Envelope.

    Declaration
    public Envelope()
    | Edit this page View Source

    Envelope(Coordinate)

    Creates an Envelope for a region defined by a single Coordinate.

    Declaration
    public Envelope(Coordinate p)
    Parameters
    Type Name Description
    Coordinate p

    The Coordinate.

    | Edit this page View Source

    Envelope(Coordinate, Coordinate)

    Creates an Envelope for a region defined by two Coordinates.

    Declaration
    public Envelope(Coordinate p1, Coordinate p2)
    Parameters
    Type Name Description
    Coordinate p1

    The first Coordinate.

    Coordinate p2

    The second Coordinate.

    | Edit this page View Source

    Envelope(CoordinateSequence)

    Creates an Envelope for a region defined by a CoordinateSequences.

    Declaration
    public Envelope(CoordinateSequence sequence)
    Parameters
    Type Name Description
    CoordinateSequence sequence

    The CoordinateSequence.

    | Edit this page View Source

    Envelope(Envelope)

    Create an Envelope from an existing Envelope.

    Declaration
    public Envelope(Envelope env)
    Parameters
    Type Name Description
    Envelope env

    The Envelope to initialize from.

    | Edit this page View Source

    Envelope(IEnumerable<Coordinate>)

    Creates an Envelope for a region defined by an enumeration of Coordinates.

    Declaration
    public Envelope(IEnumerable<Coordinate> pts)
    Parameters
    Type Name Description
    IEnumerable<Coordinate> pts

    The Coordinates.

    | Edit this page View Source

    Envelope(double, double, double, double)

    Creates an Envelope for a region defined by maximum and minimum values.

    Declaration
    public Envelope(double x1, double x2, double y1, double y2)
    Parameters
    Type Name Description
    double x1

    The first x-value.

    double x2

    The second x-value.

    double y1

    The first y-value.

    double y2

    The second y-value.

    Properties

    | Edit this page View Source

    Area

    Gets the area of this envelope.

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

    The area of the envelope, or 0.0 if envelope is null

    | Edit this page View Source

    Centre

    Computes the coordinate of the centre of this envelope (as long as it is non-null).

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

    The centre coordinate of this envelope, or null if the envelope is null.

    | Edit this page View Source

    Diameter

    Gets the length of the diameter (diagonal) of the envelope.

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

    The diameter length

    | Edit this page View Source

    Height

    Returns the difference between the maximum and minimum y values.

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

    max y - min y, or 0 if this is a null Envelope.

    | Edit this page View Source

    IsNull

    Returns true if this Envelope is a "null" envelope.

    Declaration
    public bool IsNull { get; }
    Property Value
    Type Description
    bool

    true if this Envelope is uninitialized or is the envelope of the empty point.

    | Edit this page View Source

    MaxExtent

    Gets the maximum extent of this envelope across both dimensions.

    Declaration
    public double MaxExtent { get; }
    Property Value
    Type Description
    double
    | Edit this page View Source

    MaxX

    Returns the Envelopes maximum x-value. min x > max x indicates that this is a null Envelope.

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

    The maximum x-coordinate.

    | Edit this page View Source

    MaxY

    Returns the Envelopes maximum y-value. min y > max y indicates that this is a null Envelope.

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

    The maximum y-coordinate.

    | Edit this page View Source

    MinExtent

    Gets the minimum extent of this envelope across both dimensions.

    Declaration
    public double MinExtent { get; }
    Property Value
    Type Description
    double
    | Edit this page View Source

    MinX

    Returns the Envelopes minimum x-value. min x > max x indicates that this is a null Envelope.

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

    The minimum x-coordinate.

    | Edit this page View Source

    MinY

    Returns the Envelopes minimum y-value. min y > max y indicates that this is a null Envelope.

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

    The minimum y-coordinate.

    | Edit this page View Source

    Width

    Returns the difference between the maximum and minimum x values.

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

    max x - min x, or 0 if this is a null Envelope.

    Methods

    | Edit this page View Source

    CompareTo(Envelope)

    Compares two envelopes using lexicographic ordering. The ordering comparison is based on the usual numerical comparison between the sequence of ordinates. Null envelopes are less than all non-null envelopes.

    Declaration
    public int CompareTo(Envelope env)
    Parameters
    Type Name Description
    Envelope env

    An envelope

    Returns
    Type Description
    int
    | Edit this page View Source

    CompareTo(object)

    Compares two envelopes using lexicographic ordering. The ordering comparison is based on the usual numerical comparison between the sequence of ordinates. Null envelopes are less than all non-null envelopes.

    Declaration
    public int CompareTo(object o)
    Parameters
    Type Name Description
    object o

    An envelope

    Returns
    Type Description
    int
    | Edit this page View Source

    Contains(Coordinate)

    Tests if the given point lies in or on the envelope.

    Declaration
    public bool Contains(Coordinate p)
    Parameters
    Type Name Description
    Coordinate p

    the point which this Envelope is being checked for containing

    Returns
    Type Description
    bool

    true if the point lies in the interior or on the boundary of this Envelope.

    Remarks

    Note that this is not the same definition as the SFS contains, which would exclude the envelope boundary.

    | Edit this page View Source

    Contains(Envelope)

    Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary).

    Declaration
    public bool Contains(Envelope other)
    Parameters
    Type Name Description
    Envelope other
    Returns
    Type Description
    bool

    true if other is contained in this Envelope

    Remarks

    Note that this is not the same definition as the SFS contains, which would exclude the envelope boundary.

    | Edit this page View Source

    Contains(double, double)

    Tests if the given point lies in or on the envelope.

    Declaration
    public bool Contains(double x, double y)
    Parameters
    Type Name Description
    double x

    the x-coordinate of the point which this Envelope is being checked for containing

    double y

    the y-coordinate of the point which this Envelope is being checked for containing

    Returns
    Type Description
    bool

    true if (x, y) lies in the interior or on the boundary of this Envelope.

    Remarks

    Note that this is not the same definition as the SFS contains, which would exclude the envelope boundary.

    | Edit this page View Source

    ContainsProperly(Envelope)

    Tests if an envelope is properly contained in this one. The envelope is properly contained if it is contained by this one but not equal to it.

    Declaration
    public bool ContainsProperly(Envelope other)
    Parameters
    Type Name Description
    Envelope other

    The envelope to test

    Returns
    Type Description
    bool

    true if the envelope is properly contained

    | Edit this page View Source

    Copy()

    Creates a deep copy of the current envelope.

    Declaration
    public Envelope Copy()
    Returns
    Type Description
    Envelope
    | Edit this page View Source

    Covers(Coordinate)

    Tests if the given point lies in or on the envelope.

    Declaration
    public bool Covers(Coordinate p)
    Parameters
    Type Name Description
    Coordinate p

    the point which this Envelope is being checked for containing

    Returns
    Type Description
    bool

    true if the point lies in the interior or on the boundary of this Envelope.

    | Edit this page View Source

    Covers(Envelope)

    Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary).

    Declaration
    public bool Covers(Envelope other)
    Parameters
    Type Name Description
    Envelope other

    the Envelope to check

    Returns
    Type Description
    bool

    true if this Envelope covers the other

    | Edit this page View Source

    Covers(double, double)

    Tests if the given point lies in or on the envelope.

    Declaration
    public bool Covers(double x, double y)
    Parameters
    Type Name Description
    double x

    the x-coordinate of the point which this Envelope is being checked for containing

    double y

    the y-coordinate of the point which this Envelope is being checked for containing

    Returns
    Type Description
    bool

    true if (x, y) lies in the interior or on the boundary of this Envelope.

    | Edit this page View Source

    Disjoint(Envelope)

    Tests if the region defined by other is disjoint from the region of this Envelope.

    Declaration
    public bool Disjoint(Envelope other)
    Parameters
    Type Name Description
    Envelope other

    The Envelope being checked for disjointness

    Returns
    Type Description
    bool

    true if the Envelopes are disjoint

    See Also
    Intersects(Envelope)
    | Edit this page View Source

    Distance(Envelope)

    Computes the distance between this and another Envelope. The distance between overlapping Envelopes is 0. Otherwise, the distance is the Euclidean distance between the closest points.

    Declaration
    public double Distance(Envelope env)
    Parameters
    Type Name Description
    Envelope env
    Returns
    Type Description
    double

    The distance between this and another Envelope.

    | Edit this page View Source

    Equals(Envelope)

    Declaration
    public bool Equals(Envelope other)
    Parameters
    Type Name Description
    Envelope other
    Returns
    Type Description
    bool
    | Edit this page View Source

    Equals(object)

    Declaration
    public override bool Equals(object o)
    Parameters
    Type Name Description
    object o
    Returns
    Type Description
    bool
    Overrides
    object.Equals(object)
    | Edit this page View Source

    ExpandBy(double)

    Expands this envelope by a given distance in all directions. Both positive and negative distances are supported.

    Declaration
    public void ExpandBy(double distance)
    Parameters
    Type Name Description
    double distance

    The distance to expand the envelope.

    | Edit this page View Source

    ExpandBy(double, double)

    Expands this envelope by a given distance in all directions. Both positive and negative distances are supported.

    Declaration
    public void ExpandBy(double deltaX, double deltaY)
    Parameters
    Type Name Description
    double deltaX

    The distance to expand the envelope along the the X axis.

    double deltaY

    The distance to expand the envelope along the the Y axis.

    | Edit this page View Source

    ExpandToInclude(Coordinate)

    Enlarges this Envelope so that it contains the given Coordinate. Has no effect if the point is already on or within the envelope.

    Declaration
    public void ExpandToInclude(Coordinate p)
    Parameters
    Type Name Description
    Coordinate p

    The Coordinate.

    | Edit this page View Source

    ExpandToInclude(Envelope)

    Enlarges this Envelope so that it contains the other Envelope. Has no effect if other is wholly on or within the envelope.

    Declaration
    public void ExpandToInclude(Envelope other)
    Parameters
    Type Name Description
    Envelope other

    the Envelope to expand to include.

    | Edit this page View Source

    ExpandToInclude(double, double)

    Enlarges this Envelope so that it contains the given Coordinate.

    Declaration
    public void ExpandToInclude(double x, double y)
    Parameters
    Type Name Description
    double x

    The value to lower the minimum x to or to raise the maximum x to.

    double y

    The value to lower the minimum y to or to raise the maximum y to.

    Remarks

    Has no effect if the point is already on or within the envelope.

    | Edit this page View Source

    ExpandedBy(Envelope)

    Enlarges this Envelope so that it contains the other Envelope. Has no effect if other is wholly on or within the envelope.

    Declaration
    public Envelope ExpandedBy(Envelope other)
    Parameters
    Type Name Description
    Envelope other

    the Envelope to expand to include.

    Returns
    Type Description
    Envelope
    | Edit this page View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    object.GetHashCode()
    | Edit this page View Source

    Init()

    Initialize to a null Envelope.

    Declaration
    public void Init()
    | Edit this page View Source

    Init(Coordinate)

    Initialize an Envelope for a region defined by a single Coordinate.

    Declaration
    public void Init(Coordinate p)
    Parameters
    Type Name Description
    Coordinate p

    The Coordinate.

    | Edit this page View Source

    Init(Coordinate, Coordinate)

    Initialize an Envelope for a region defined by two Coordinates.

    Declaration
    public void Init(Coordinate p1, Coordinate p2)
    Parameters
    Type Name Description
    Coordinate p1

    The first Coordinate.

    Coordinate p2

    The second Coordinate.

    | Edit this page View Source

    Init(Envelope)

    Initialize an Envelope from an existing Envelope.

    Declaration
    public void Init(Envelope env)
    Parameters
    Type Name Description
    Envelope env

    The Envelope to initialize from.

    | Edit this page View Source

    Init(double, double, double, double)

    Initialize an Envelope for a region defined by maximum and minimum values.

    Declaration
    public void Init(double x1, double x2, double y1, double y2)
    Parameters
    Type Name Description
    double x1

    The first x-value.

    double x2

    The second x-value.

    double y1

    The first y-value.

    double y2

    The second y-value.

    | Edit this page View Source

    Intersection(Envelope)

    Computes the intersection of two Envelopes.

    Declaration
    public Envelope Intersection(Envelope env)
    Parameters
    Type Name Description
    Envelope env

    The envelope to intersect with

    Returns
    Type Description
    Envelope

    A new Envelope representing the intersection of the envelopes (this will be the null envelope if either argument is null, or they do not intersect

    | Edit this page View Source

    Intersects(Coordinate)

    Check if the point p overlaps (lies inside) the region of this Envelope.

    Declaration
    public bool Intersects(Coordinate p)
    Parameters
    Type Name Description
    Coordinate p

    the Coordinate to be tested.

    Returns
    Type Description
    bool

    true if the point overlaps this Envelope.

    | Edit this page View Source

    Intersects(Coordinate, Coordinate)

    Tests if the extent defined by two extremal points intersects the extent of this Envelope.

    Declaration
    public bool Intersects(Coordinate a, Coordinate b)
    Parameters
    Type Name Description
    Coordinate a

    A point

    Coordinate b

    Another point

    Returns
    Type Description
    bool

    true if the extents intersect

    | Edit this page View Source

    Intersects(Coordinate, Coordinate, Coordinate)

    Test the point q to see whether it intersects the Envelope defined by p1-p2.

    Declaration
    public static bool Intersects(Coordinate p1, Coordinate p2, Coordinate q)
    Parameters
    Type Name Description
    Coordinate p1

    One extremal point of the envelope.

    Coordinate p2

    Another extremal point of the envelope.

    Coordinate q

    Point to test for intersection.

    Returns
    Type Description
    bool

    true if q intersects the envelope p1-p2.

    | Edit this page View Source

    Intersects(Coordinate, Coordinate, Coordinate, Coordinate)

    Tests whether the envelope defined by p1-p2 and the envelope defined by q1-q2 intersect.

    Declaration
    public static bool Intersects(Coordinate p1, Coordinate p2, Coordinate q1, Coordinate q2)
    Parameters
    Type Name Description
    Coordinate p1

    One extremal point of the envelope Point.

    Coordinate p2

    Another extremal point of the envelope Point.

    Coordinate q1

    One extremal point of the envelope Q.

    Coordinate q2

    Another extremal point of the envelope Q.

    Returns
    Type Description
    bool

    true if Q intersects Point

    | Edit this page View Source

    Intersects(Envelope)

    Check if the region defined by other intersects the region of this Envelope.

    A null envelope never intersects.
    Declaration
    public bool Intersects(Envelope other)
    Parameters
    Type Name Description
    Envelope other

    The Envelope which this Envelope is being checked for intersecting.

    Returns
    Type Description
    bool

    true if the Envelopes intersect.

    | Edit this page View Source

    Intersects(double, double)

    Check if the point (x, y) overlaps (lies inside) the region of this Envelope.

    Declaration
    public bool Intersects(double x, double y)
    Parameters
    Type Name Description
    double x

    the x-ordinate of the point.

    double y

    the y-ordinate of the point.

    Returns
    Type Description
    bool

    true if the point overlaps this Envelope.

    | Edit this page View Source

    Parse(string)

    Method to parse an envelope from its ToString() value

    Declaration
    public static Envelope Parse(string envelope)
    Parameters
    Type Name Description
    string envelope

    The envelope string

    Returns
    Type Description
    Envelope

    The envelope

    | Edit this page View Source

    SetToNull()

    Makes this Envelope a "null" envelope..

    Declaration
    public void SetToNull()
    | Edit this page View Source

    ToString()

    Function to get a textual representation of this envelope

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A textual representation of this envelope

    Overrides
    object.ToString()
    | Edit this page View Source

    Translate(double, double)

    Translates this envelope by given amounts in the X and Y direction.

    Declaration
    public void Translate(double transX, double transY)
    Parameters
    Type Name Description
    double transX

    The amount to translate along the X axis.

    double transY

    The amount to translate along the Y axis.

    Implements

    IComparable<T>
    IIntersectable<T>
    IExpandable<T>
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX