Table of Contents

Struct Envelope2D

Namespace
SpatialNET
Assembly
SpatialNET.Core.dll

The envelope: the axis-aligned rectangle that encloses a geometry. A value, not an interface; hosts do not have to implement anything (ADR 0002).

public readonly record struct Envelope2D : IEquatable<Envelope2D>

Implements

Inherited Members

Extension Methods

Constructors

Envelope2D(double, double, double, double)

The envelope: the axis-aligned rectangle that encloses a geometry. A value, not an interface; hosts do not have to implement anything (ADR 0002).

public Envelope2D(double MinX, double MinY, double MaxX, double MaxY)

Parameters

MinX double

Smallest X coordinate.

MinY double

Smallest Y coordinate.

MaxX double

Largest X coordinate.

MaxY double

Largest Y coordinate.

Properties

Center

The center; both values are System.Double.NaN if SpatialNET.Envelope2D.IsEmpty.

public Coordinate Center { get; }

Property Value

Coordinate

Empty

The envelope of an empty geometry; all values are System.Double.NaN.

public static Envelope2D Empty { get; }

Property Value

Envelope2D

Height

The extent in Y direction; System.Double.NaN if SpatialNET.Envelope2D.IsEmpty.

public double Height { get; }

Property Value

double

IsEmpty

Whether this is the envelope of an empty geometry.

public bool IsEmpty { get; }

Property Value

bool

MaxX

Largest X coordinate.

public double MaxX { get; init; }

Property Value

double

MaxY

Largest Y coordinate.

public double MaxY { get; init; }

Property Value

double

MinX

Smallest X coordinate.

public double MinX { get; init; }

Property Value

double

MinY

Smallest Y coordinate.

public double MinY { get; init; }

Property Value

double

Width

The extent in X direction; System.Double.NaN if SpatialNET.Envelope2D.IsEmpty.

public double Width { get; }

Property Value

double

Methods

Contains(Envelope2D)

Whether other lies completely in this envelope (the border counts). An empty envelope contains nothing and lies in nothing.

public bool Contains(Envelope2D other)

Parameters

other Envelope2D

The other envelope.

Returns

bool

Contains(Coordinate)

Whether the point lies in this envelope (the border counts); a point with a System.Double.NaN value does not.

public bool Contains(Coordinate point)

Parameters

point Coordinate

The point.

Returns

bool

Expand(double)

The envelope widened on all sides by distance; a negative distance shrinks it and gives SpatialNET.Envelope2D.Empty if nothing is left. An empty envelope, or a System.Double.NaN distance, gives SpatialNET.Envelope2D.Empty.

public Envelope2D Expand(double distance)

Parameters

distance double

The distance; negative to shrink.

Returns

Envelope2D

Intersection(Envelope2D)

The common part of both envelopes; SpatialNET.Envelope2D.Empty if they do not meet.

public Envelope2D Intersection(Envelope2D other)

Parameters

other Envelope2D

The other envelope.

Returns

Envelope2D

Intersects(Envelope2D)

Whether the two envelopes touch or overlap (closed intervals). An empty envelope meets nothing.

public bool Intersects(Envelope2D other)

Parameters

other Envelope2D

The other envelope.

Returns

bool

Union(Envelope2D)

The smallest envelope that contains both; the other one if this or other is empty.

public Envelope2D Union(Envelope2D other)

Parameters

other Envelope2D

The other envelope.

Returns

Envelope2D