IGeometryBag and
IGeometryCollection are two interfaces that serve different purposes. IGeometryBag’s main functions are in regard to the Spatial Reference of the geometry or geometries that are referenced as elements of the GeometryBag. IGeometryCollection functions involve the creation of new geometries from collections of more simple geometries. IGeometryCollection can insert and rearrange elements within the composite object as well as create the composite objects from constituent parts.
IGeometryBag gives the user access to methods that affect the spatial reference of a GeometryBag and the geometry references it contains. Setting the GeometryBag’s spatial reference before adding references to geometries to the GeometryBag is important. Without this step the geometry’s spatial reference will automatically be set to whatever the GeometryBag’s spatial reference is even if it is not yet defined. Geometries added to the GeometryBag will inherit the GeometryBag's spatial reference. Make sure that the geometries you plan to reference are already in the same coordinate system. However, if the resolution and spatial domain values differ, you can use the SnapToSpatialReference method to ensure that all the elements have the same resolution value and coordinate grid. Resolution and coordinate grid values are important if the user wishes to do any analysis on the data particularly using ITopologicalOperator or IRelationalOperator. Through the Project method the user can change the spatial reference of the GeometryBag and all of its elements. If the input and output spatial references use different geographic coordinate systems, it is important to remember that Project will not work properly if the GeotransformationOperationSet does not contain an appropriate Geotransformation. You can not call Project on a GeometryBag that does not have its spatial reference property already defined. Also, the Project/ProjectEx methods should not be applied on GeometryBag if it contains segments this is not supported and will result in an error. These methods and properties are powerful and allow properties to be changed in all the elements of the GeometryBag.
IGeometryCollection is implemented by several collection objects including GeometryBag. IGeometryCollection allows for the addition, removal, insertion, and manipulation of elements from these collection objects. Also, setting specific parts of a composite geometry is available with this interface. Only two properties are accessible in read only format from IGeometryCollection: a reference to the ith geometry through IGeometryCollection::Geometry and the total number of geometries in the collection through IGeometryCollection::GeometryCount. Several of the methods on IGeometryCollection that involve adding arrays of geometries must be performed using IGeometryBridge or IGeometryBridge2 when programming in Java or any of the .NET languages. After changing the properties of the elements referenced in a collection object it is important to call IGeometryCollection::GeometriesChanged so that it can delete any cached properties that it might be maintaining, such as envelope, length, or area.