This document is archived and information here might be outdated.  Recommended version.


Envelope Class (ArcObjects .NET 10.7 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Classes > E > Envelope Class
ArcGIS Developer Help

EnvelopeClass Class

A rectangle with sides parallel to a coordinate system defining the extent of another geometry; optionally has min and max measure, height and ID attributes.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

The Envelope coclass defines a rectangular shape by its minimum and maximum x,y coordinates. Therefore, an Envelope is always orthogonal to its SpatialReference. An Envelope may also define minimum and maximum z- and m-values, depending on the implemented IZAware and IMAware interfaces.

Supported Platforms

Windows, Solaris, Linux

Extended Error Information

Use the ISupportErrorInfo method InterfaceSupportsErrorInfo to determine if the object supports extended error information. If the object supports extended error info, VC++ developers should use the OLE/COM IErrorInfo interface to access the ErrorInfo object. Visual Basic developers should use the global error object Err to retrieve this extended error information.

Interfaces

Interfaces Description
IArea Provides access to members that return properties common to rings and polygons.
IArea3D Provides access to members that return properties common to MultiPatches.
IClone (esriSystem) Provides access to members that control cloning of objects.
IEnvelope Provides access to methods and properties of envelopes.
IEnvelope2 Provides access to members that extend the IEnvelope interface.
IEnvelope3D Provides access to methods on 3D envelopes.
IEnvelope4 Provides further access to methods on 3D envelopes.
IEnvelopeGEN OLE Automation compatibility interface for IEnvelope.
IGeometry Provides access to members that describe properties and behavior of all geometric objects.
IGeometry2 Provides access to members that extend the IGeometry interface with a more sophisticated projection method.
IGeometry3 Provides rapid access to a geometry's extent in the x-y plane.
IGeometry4 Provides access to methods that indicate if a geometry has been changed (edited, projected, etc).
IGeometry5 Provides access to members that extend the IGeometry interface with a more sophisticated projection method.
IHitTest Provides access to members that locate a part of a geometry closest to a point.
IHitTest3D Provides access to members that locate a part of a geometry closest to a point.
IMAware Indicator interface that identifies geometric objects that can have persistent M values attached to their vertices.
IPersist (esriSystem)
IPersistStream (esriSystem)
IProximityOperator Provides access to members that find the 2D distance between two geometries.
IProximityOperator3D Provides access to members that find the 3D distance between two geometries with Zs.
IRelationalOperator Provides access to members that determine if a certain spatial relationship exists between two geometries.
IRelationalOperator2 Additional relational functions.
IRelationalOperator3D Provides access to members that determine if a certain spatial relationship exists between two geometries with Zs.
IRelationalOperator3D2 Provides access to members that determine if a certain spatial relationship exists between two geometries with Zs.
ISupportErrorInfo (esriSystem)
ITransform2D Provides access to methods for transforming geometries using either specific parameters or arbitrary transformation objects (affine transformations, geographic transformations, etc.).
IVolume Provides access to members that return properties common to MultiPatches.
IXMLSerialize (esriSystem) Provides access to members that XML serialize and deserialize an object to/from XML.
IZAware Indicator interface that identifies geometries that can have persistent Z values attached to their vertices.
[C#]

 

        public static IGeometry GetEnvelopeGeometry()

        {

            const double DeltaX = 2.5;

            const double DeltaY = 2.5;

            const double DeltaZ = 2.5;

 

            IPoint centerPoint = GetPoint();

 

            IEnvelope envelope = new EnvelopeClass();

            envelope.XMin = centerPoint.X - DeltaX;

            envelope.XMax = centerPoint.X + DeltaX;

            envelope.YMin = centerPoint.Y - DeltaY;

            envelope.YMax = centerPoint.Y + DeltaY;

            envelope.ZMin = centerPoint.Z - DeltaZ;

            envelope.ZMax = centerPoint.Z + DeltaZ;

 

            MakeZAware(envelope as IGeometry);

 

            return envelope as IGeometry;

        }

        private static IPoint GetPoint()

        {

            const double Min = -10;

            const double Max = 10;

 

            Random random = new Random();

 

            double x = Min + (Max - Min) * random.NextDouble();

            double y = Min + (Max - Min) * random.NextDouble();

            double z = Min + (Max - Min) * random.NextDouble();

 

            return ConstructPoint3D(x, y, z);

        }

 

        private static IPoint ConstructPoint3D(double x, double y, double z)

        {

            IPoint point = ConstructPoint2D(x, y);

            point.Z = z;

           
return point;

        }


        private static IPoint ConstructPoint2D(double x, double y)

        {

            IPoint point = new PointClass();

            point.PutCoords(x, y);
 

            return point;

        }

        private static void MakeZAware(IGeometry geometry)

        {

            IZAware zAware = geometry as IZAware;

            zAware.ZAware = true;

        }