// Create a point geometry var point = new MapPoint(0, 0, SpatialReferences.WebMercator); // Expand the point's bounding box by 100 units in all directions point.Envelope = point.Envelope.Expand(100, 100, 100, 100);
// Create a polygon geometry var polygon = new PolygonBuilder(SpatialReferences.WebMercator) .AddPoint(-10000000, 5000000) .AddPoint(-10000000, -5000000) .AddPoint(10000000, -5000000) .AddPoint(10000000, 5000000) .ToGeometry(); // Expand the polygon's bounding box by 10% in each direction polygon.Envelope = polygon.Envelope.Expand(0.1, 0.1, 0.1, 0.1);In this example, we create a polygon using the PolygonBuilder class, specifying web mercator as the spatial reference. We then use the Expand method to add 10% to the bounding box in each direction, resulting in a larger area of interest around the polygon. Overall, the IEnvelope Expand method is a useful tool for creating buffers or expanding the area of interest around a geometry object.