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.

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

          }

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.