0
我有一組多部分折線幾何圖形,其中包含一些度量。我正在嘗試重新排列幾何圖形以更好地跟蹤交通流量。 我正在使用GeometryBridge將重新排序的片段添加到ISegmentCollection。 問題是我的段的M值重置,因此它們必須是IMSegmentation4段。當我嘗試將這些添加到ISegmentCollection VS時,程序將無法編譯。 我使用VS2010時,ArcGIS 10.2和Windows 7更改多部分幾何圖形的順序
pExGeomColl = (IGeometryCollection)new Polyline();
pExGeomColl = (IGeometryCollection)pBaseFeat.ShapeCopy;
for (int i = 0; i < hGeomToFrom.Count; i++)
{
iTo = i;
iFrom = (int)hGeomToFrom[i];
pGeom = pExGeomColl.Geometry[iFrom];
pGeom.SpatialReference = pSpRef;
pMAware = (IMAware)pGeom;
pMAware.MAware = true;
pPolyline = (IPolyline6)new PolylineClass();
if (pGeom.GeometryType != esriGeometryType.esriGeometryPolyline)
{
pPolyline = geometryToPolyline(pGeom, false, true, ref sError);
if (sError.Length > 0)
{
sError = "cmdReset\r\n" + sError;
clsMain.write_log(sError, clsMain.m_eLogType.FATAL);
MessageBox.Show(sError);
return;
}
}
else
{
pPolyline = (IPolyline)pGeom;
}
dLen = pPolyline.Length;
dFrom = dMeasure;
dTo = dFrom + dLen;
pSeg = (IMSegmentation4)pPolyline;
pSeg.SetAndInterpolateMsBetween(dFrom, dTo);
dMeasure = dTo;
pSegArray[i] = pSeg;
ProgressBar1.Value = iCount;
iCount++;
}
// Add the segment array to a segment collection
pNewSegColl = (ISegmentCollection)new PolylineClass();
pMAware = (IMAware)pNewSegColl;
pMAware.MAware = true;
pGeomBridge = new GeometryEnvironmentClass();
pGeomBridge.AddSegments(pNewSegColl, pSegArray); // This doesn't work
pGeom = (IGeometry)pNewSegColl;
pGeom.SpatialReference = pSpRef;
pBaseFeat.Shape = pGeom;
pBaseFeat.Store();
誰能告訴我如何積累了一套衡量段?