AutoCAD Map 3D 2009 Geospatial Platform Reference

AutoCAD Map 3D Geospatial Platform API

virtual MgEnvelope* MgCoordinateSystemMeasure::GetEnvelope (  )  [pure virtual]

Computes the envelope of the MgCoordinateSystemMeasure object.

.NET Syntax
virtual MgEnvelope GetEnvelope();
Java Syntax
virtual MgEnvelope GetEnvelope();
PHP Syntax
virtual MgEnvelope GetEnvelope();

Example (PHP) For this particular $coordSysMeasure, the value of $lowerLeft is (-180, -90) and the value of $upperRight is (180, 90). The width of the envelope is 360, and the height is 180.
 $envelope = $coordSysMeasure->GetEnvelope();
 $lowerLeft = $envelope->GetLowerLeftCoordinate();
 $upperRight = $envelope->GetUpperRightCoordinate();
 $width = $envelope->GetWidth();
 $height = $envelope->GetHeight();
 $depth = $envelope->GetDepth();

Example (C#)
 using OSGeo.MapGuide;
 private MgGeometryFactory geometryFactory;
 private MgEnvelope geogCSEnvelope;
 private double geogCSMaxX = 180;
 private double geogCSMaxY = 90;
 private double geogCSMinX = -180;
 private double geogCSMinY = -90;
 private MgCoordinate lowerLeft;
 private MgCoordinate upperRight;
 private double tolerance = 0.001;
 private Boolean isEquivalent;

 envelope = geogCSMeasure.GetEnvelope();
 lowerLeft = envelope.GetLowerLeftCoordinate();
 upperRight = envelope.GetUpperRightCoordinate();
 // the lower left and upper right coordinates of the envelope are equal to the coordinate system's lower left and upper right coordinates
 isEquivalent = Math.Abs(geogCSMinX - lowerLeft.GetX()) < tolerance && Math.Abs(geogCSMinY - lowerLeft.GetY()) < tolerance;
 isEquivalent = Math.Abs(geogCSMaxX - upperRight.GetX()) < tolerance && Math.Abs(geogCSMaxY - upperRight.GetY()) < tolerance;

Exceptions:
MgCoordinateSystemMeasureFailedException