MapGuide API Reference
|
An MgMultiGeometry is a heterogeneous aggregate of one or more MgGeometry objects. More...
Public Member Functions | |
virtual MgGeometricEntity * | Copy () |
virtual INT32 | GetCount () |
virtual INT32 | GetDimension () |
virtual MgGeometry * | GetGeometry (INT32 index) |
virtual INT32 | GetGeometryType () |
virtual bool | IsClosed () |
virtual bool | IsEmpty () |
virtual MgGeometricEntity * | Transform (MgTransform *transform) |
Returns a transformed copy of this geometric entity. |
An MgMultiGeometry is a heterogeneous aggregate of one or more MgGeometry objects.
$geometryFactory = new MgGeometryFactory(); $geometryCollection = new MgGeometryCollection(); // After each MgGeometry is constructed, // it is added to the MgGeometryCollection. $index = $geometryCollection->Add($point); $index = $geometryCollection->Add($multiPoint); $index = $geometryCollection->Add($lineString); $index = $geometryCollection->Add($multiLineString); $index = $geometryCollection->Add($curveString); $index = $geometryCollection->Add($multiCurveString); $index = $geometryCollection->Add($polygon); $index = $geometryCollection->Add($multiPolygon); $index = $geometryCollection->Add($curvePolygon); $index = $geometryCollection->Add($multiCurvePolygon); // construct the MgMultiGeometry geometry $multiGeometry = $geometryFactory->CreateMultiGeometry($geometryCollection); // print out the Agf Text string for the geometry $multiGeometryAgfText = $wktReaderWriter->Write($multiGeometry); echo "AGF Text representation of MultiGeometry: $multiGeometryAgfText\n";
using OSGeo.MapGuide; private MgWktReaderWriter wktReaderWriter; private MgGeometryFactory geometryFactory; private MgMultiGeometry multiGeom; private MgGeometryCollection geometries; private MgPoint pt11; private MgLineString ls1121; private String geometryAgfText; geometries = new MgGeometryCollection(); geometryFactory = new MgGeometryFactory(); // Review the MgPoint example code for the construction of the point geometry. geometries.Add(pt11 as MgGeometry); // Review the MgLineString example code for the construction of the line string geometry. geometries.Add(ls1121 as MgGeometry); multiGeom = geometryFactory.CreateMultiGeometry(geometries); // print out the Agf Text string for the geometry wktReaderWriter = new MgWktReaderWriter(); geometryAgfText = wktReaderWriter.Write(multiGeom); // geometryAgfText now contains: // "GEOMETRYCOLLECTION ( POINT XY ( 1 1 ), LINESTRING XY ( 1 1, 2 1 ) )"