|
MapGuide API Reference
|
An MgMultiPoint is a 0 dimensional aggregate geometry whose elements are MgPoint geometries. More...
Inheritance diagram for MgMultiPoint:Public Member Functions | |
| virtual MgGeometricEntity * | Copy () |
| virtual INT32 | GetCount () |
| virtual INT32 | GetDimension () |
| virtual INT32 | GetGeometryType () |
| virtual MgPoint * | GetPoint (INT32 index) |
| virtual bool | IsClosed () |
| virtual bool | IsEmpty () |
| virtual MgGeometricEntity * | Transform (MgTransform *transform) |
| Returns a transformed copy of this geometric entity. | |
An MgMultiPoint is a 0 dimensional aggregate geometry whose elements are MgPoint geometries.
// A helper class additional to those created in the // MgPoint example code is needed. $pointCollection = new MgPointCollection(); // After each MgPoint geometry is constructed, // it is added to an MgPointCollection. $index = $pointCollection->Add($point); echo "A point is added to a point collection at index: $index\n"; // construct the MgMultiPoint geometry $multiPoint = $geometryFactory->CreateMultiPoint($pointCollection); // print out the Agf Text string for the geometry $multiPointAgfText = $wktReaderWriter->Write($multiPoint); echo "AGF Text representation of MultiPoint: $multiPointAgfText\n";
using OSGeo.MapGuide; private MgWktReaderWriter wktReaderWriter; private MgGeometryFactory geometryFactory; private MgMultiPoint mpt1121; private double[,] da1121 = { { 1, 1 }, { 2, 1 } }; private String geometryAgfText; public MgMultiPoint CreateAMultiPointXY(double[,] multiPointData) { MgPointCollection points = new MgPointCollection(); for (int i = 0; i < multiPointData.GetLength(0); i++) { points.Add(CreateAPointXY(multiPointData[i, 0], multiPointData[i, 1])); } return geometryFactory.CreateMultiPoint(points); } geometryFactory = new MgGeometryFactory(); mpt1121 = CreateAMultiPointXY(da1121); // print out the Agf Text string for the geometry wktReaderWriter = new MgWktReaderWriter(); geometryAgfText = wktReaderWriter.Write(mpt1121); // geometryAgfText now contains: // "MULTIPOINT XY ( 1 1, 2 1 )"