MapGuide API Reference
|
An MgMultiCurveString is a one-dimensional aggregate geometry whose elements are MgCurveString geometries. More...
Public Member Functions | |
virtual MgGeometricEntity * | Copy () |
virtual INT32 | GetCount () |
virtual MgCurveString * | GetCurveString (INT32 index) |
virtual INT32 | GetDimension () |
virtual INT32 | GetGeometryType () |
virtual bool | IsClosed () |
virtual bool | IsEmpty () |
virtual MgGeometricEntity * | Transform (MgTransform *transform) |
Returns a transformed copy of this geometric entity. |
An MgMultiCurveString is a one-dimensional aggregate geometry whose elements are MgCurveString geometries.
// A helper class additional to those created in the // MgCurveString example code is needed. $curveStringCollection = new MgCurveStringCollection(); // After each MgCurveString geometry is constructed, // it is added to an MgCurveStringCollection. $index = $curveStringCollection->Add($curveString); echo "A curve string is added to a curve string collection at index: $index\n"; // construct the MgMultiCurveString geometry $multiCurveString = $geometryFactory->CreateMultiCurveString($curveStringCollection); // print out the Agf Text string for the geometry $multiCurveStringAgfText = $wktReaderWriter->Write($multiCurveString); echo "AGF Text representation of MultiCurveString: $multiCurveStringAgfText\n";
using OSGeo.MapGuide; private MgWktReaderWriter wktReaderWriter; private MgMultiCurveString mcsCsAs001120Ls203132CsAs001120Ls203132; // the following arrays are used for segments of a curve string // the first coordinate in each array is actually a flag // 0 indicates an arc segment and 1 indicates a linear segment private double[,] as001120 = { { 0, 0 }, { 0, 0 }, { 1, 1 }, { 2, 0 } }; private double[,] ls203132 = { { 1, 1 }, { 2, 0 }, { 3, 1 }, { 3, 2 } }; private double[][,] csAs001120Ls203132Data; // the data for 2 curvestrings private double[][][,] mcsCsAs001120Ls203132CsAs001120Ls203132Data; private String geometryAgfText; public MgMultiCurveString CreateAMultiCurveStringXY(double[][][,] curveStrings) { MgCurveStringCollection curves = new MgCurveStringCollection(); for (int i = 0; i < curveStrings.GetLength(0); i++) { curves.Add(CreateACurveStringXY(curveStrings[i])); } return geometryFactory.CreateMultiCurveString(curves); } csAs001120Ls203132Data = new double[2][,]; csAs001120Ls203132Data[0] = as001120; csAs001120Ls203132Data[1] = ls203132; mcsCsAs001120Ls203132CsAs001120Ls203132Data = new double[2][][,]; mcsCsAs001120Ls203132CsAs001120Ls203132Data[0] = csAs001120Ls203132Data; mcsCsAs001120Ls203132CsAs001120Ls203132Data[1] = csAs001120Ls203132Data; mcsCsAs001120Ls203132CsAs001120Ls203132 = CreateAMultiCurveStringXY(mcsCsAs001120Ls203132CsAs001120Ls203132Data); // print out the Agf Text string for the geometry wktReaderWriter = new MgWktReaderWriter(); geometryAgfText = wktReaderWriter.Write(mcsCsAs001120Ls203132CsAs001120Ls203132); // geometryAgfText now contains the AGF representation of the multi-curve string