本文整理汇总了C#中PolylineClass.Densify方法的典型用法代码示例。如果您正苦于以下问题:C# PolylineClass.Densify方法的具体用法?C# PolylineClass.Densify怎么用?C# PolylineClass.Densify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PolylineClass
的用法示例。
在下文中一共展示了PolylineClass.Densify方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProfileGetRelatedSewerElevData
//�������ĸ߳�����
public static void ProfileGetRelatedSewerElevData(AxMapControl ppAxMapControl, IGeometricNetwork pGeoNetwork, IEnumNetEID pResultEdges, IEnumNetEID pResultJunctions)
{
try
{
//��ñ������Զ�Ӧ�������ٽ��
IArray pSewerElevArray = new ArrayClass();
IEIDHelper pEIDHelper = new EIDHelperClass();
pEIDHelper.GeometricNetwork = pGeoNetwork;
pEIDHelper.ReturnFeatures = true;
pEIDHelper.ReturnGeometries = true;
pEIDHelper.PartialComplexEdgeGeometry = true;
pEIDHelper.AddField("Component_Key2");
IEnumEIDInfo pEnumEIDInfo = pEIDHelper.CreateEnumEIDInfo(pResultEdges);
//������������ص�������¼
pEnumEIDInfo.Reset();
IEIDInfo pEIDInfo = pEnumEIDInfo.Next();
IFeature pFeature = pEIDInfo.Feature;
IGeometry pFeatGeo = pEIDInfo.Geometry;
//�������л�ù�ϵ
IEnumRelationshipClass pEnumRelationshipCls = pFeature.Class.get_RelationshipClasses(esriRelRole.esriRelRoleOrigin);
pEnumRelationshipCls.Reset();
IRelationshipClass pRelationshipCls = pEnumRelationshipCls.Next();
//�����ȷ�Ĺ�ϵ��
string s = "SewerToMainline";
while (pRelationshipCls != null)
{
if (pRelationshipCls.ForwardPathLabel.ToUpper() == s.ToUpper())
break;
else
pRelationshipCls = pEnumRelationshipCls.Next();
}
//��ѯ���ɹ�����ÿ������ص����ݣ������1-1�Ĺ�ϵ����ֻ����һ����¼
// because the arcs are ordered and directional, if the start node is an
// fnode then get subsequent tnode's for the rest of the arcs, else if the
// start node is a tnode, get subsequent fnode's. Related data has elev
// attributes for up and down stream manhole elevs, so related to from and to node of arc.
// get the first junction in the network trace results to determine if the
//first junction is a from-node or a to-node for graphing sewer line elev
if (pRelationshipCls != null)
{
ISet pMainlineRelatedSet;
IRow pMainlineRow;
IEIDHelper pEIDHelper2 = new EIDHelperClass();
pEIDHelper2.GeometricNetwork = pGeoNetwork;
pEIDHelper2.ReturnFeatures = true;
pEIDHelper2.ReturnGeometries = true;
pEIDHelper2.PartialComplexEdgeGeometry = true;
IEnumEIDInfo pEnumEIDInfo2 = pEIDHelper2.CreateEnumEIDInfo(pResultJunctions);
pEnumEIDInfo2.Reset();
//pFeature is the first arc in the network trace results
// check the junctions on the first arc to see which is the starting
// junction, this determines which sewer elev attribute (ups_elev, dwn_elev)
// will be used to calculate the sewer line profile
IEdgeFeature pEdgeFeat = pFeature as IEdgeFeature;
string strStartAttr;
string strMHelevAttr;
double lastelev = 0;
int lastnodeEID;
if (pEnumEIDInfo2.Next().EID == pEdgeFeat.FromJunctionEID)
{
// trace is in the direction of flow, flow goes down hill
strStartAttr = "Ups_elev";
strMHelevAttr = "Dwn_elev";
}
else
{
//trace is in the opposite direction of flow, flow goes up hill
strStartAttr = "Dwn_elev";
strMHelevAttr = "Ups_elev";
}
lastnodeEID = pEnumEIDInfo2.Next().EID;
// create a polyline from the result junctions, make the polyline in the
//direction of the trace, not in the direction of the original arcs/edges
IPolyline pPolyline = new PolylineClass();
IPointCollection pPointColl = pPolyline as IPointCollection;
pEnumEIDInfo2.Reset();
object missing = Type.Missing;
for (int i = 0; i <= pEnumEIDInfo2.Count - 1; i++)
{
pPointColl.AddPoint(pEnumEIDInfo2.Next().Geometry as IPoint, ref missing, ref missing);
}
ISegmentCollection pSegColl = pPolyline as ISegmentCollection;
//�����
ITopologicalOperator pTopoOp = pPolyline as ITopologicalOperator;
pTopoOp.Simplify();
pPolyline.SimplifyNetwork();
pPolyline.Densify(50, 0.01);
pResultEdges.Reset();
pEnumEIDInfo2.Reset();
IPolyline pNewSegPolyline;
IPolyline pPolyLineFeat;
IRelationalOperator pRelOpFeat;
ISegmentCollection pNewSegColl;
ISegmentCollection pSegmentColl = pPolyline as ISegmentCollection;
for (int i = 0; i <= pResultEdges.Count - 1; i++)
{
pMainlineRelatedSet = pRelationshipCls.GetObjectsRelatedToObject(pFeature);
pMainlineRelatedSet.Reset();
pMainlineRow = pMainlineRelatedSet.Next() as IRow;
//.........这里部分代码省略.........
示例2: ProfileGetRelatedElevData
private static void ProfileGetRelatedElevData(IApplication app, List<ProfileGraphDetails> ProfileGraph, IGeometricNetwork pGeometricNet,
IEnumNetEID pResultEdges, IEnumNetEID pResultJunctions, int CurrentDetail,
ref IFeatureLayer pFLManhole, ref IFeatureLayer pFLMain, ref IFeatureLayer pFLTap)
{
List<mainDetails> SewerColMains = null;
List<manholeDetails> SewerColManholes = null;
List<tapDetails> SewerColTap = null;
IEIDHelper pEIDHelperEdges = null;
IEnumEIDInfo pEnumEIDInfoEdges = null;
IEIDHelper pEIDHelperJunctions = null;
IEnumEIDInfo pEnumEIDInfoJunctions = null;
IPolyline pPolyline = null;
IPointCollection pPtColl = null;
IEIDInfo pEIDInfo = null;
IPoint pNewPt = null;
ISegmentCollection pSegColl = null;
IMSegmentation pMSegmentation = null;
IMAware pMAware = null;
IPointCollection pPtCollection = null;
IEnumVertex pEnumVertex;
IHitTest pHtTest = null;
IPoint pHitPntOne = null;
IPoint pHitPntTwo = null;
IFeature pFeature = null;
Hashtable pFeatureAdded = null;
mainDetails mainDet = null;
IEdgeFeature pEdge = null;
IPoint pGeoOne = null;
IPoint pGeoTwo = null;
IField pFld = null;
IJunctionFeature pJunc = null;
tapDetails tapDet = null;
manholeDetails manDet = null;
IFeatureLayer pFl = null;
ISpatialFilter pSpatFilt = null;
IFeatureCursor pFC = null;
try
{
SewerColMains = new List<mainDetails>();
SewerColManholes = new List<manholeDetails>();
SewerColTap = new List<tapDetails>();
pEIDHelperEdges = new EIDHelper();
pEIDHelperEdges.GeometricNetwork = pGeometricNet;
pEIDHelperEdges.ReturnFeatures = true;
pEIDHelperEdges.ReturnGeometries = true;
pEIDHelperEdges.PartialComplexEdgeGeometry = true;
pEnumEIDInfoEdges = pEIDHelperEdges.CreateEnumEIDInfo(pResultEdges);
pEnumEIDInfoEdges.Reset(); //edges
pEIDHelperJunctions = new EIDHelperClass();
pEIDHelperJunctions.GeometricNetwork = pGeometricNet;
pEIDHelperJunctions.ReturnFeatures = true;
pEIDHelperJunctions.ReturnGeometries = true;
pEIDHelperJunctions.PartialComplexEdgeGeometry = true;
pEnumEIDInfoJunctions = pEIDHelperJunctions.CreateEnumEIDInfo(pResultJunctions);
pEnumEIDInfoJunctions.Reset();// junctions
pPolyline = new PolylineClass();
pPolyline.SpatialReference = (pFLMain as IGeoDataset).SpatialReference;
pPtColl = (IPointCollection)pPolyline; //QI
for (int i = 0; i < pEnumEIDInfoJunctions.Count; i++)
{
pEIDInfo = pEnumEIDInfoJunctions.Next();
pNewPt = (IPoint)pEIDInfo.Geometry;
pPtColl.AddPoint(pNewPt);
}
pSegColl = (ISegmentCollection)pPolyline;
pPolyline.Densify(50, 0.01);
pMAware = (IMAware)pPolyline;//'QI
pMAware.MAware = true;
pMSegmentation = (IMSegmentation)pPolyline;
// get the M values, put the distance in m, 0 to Length
pMSegmentation.SetMsAsDistance(false);
pPtCollection = (IPointCollection)pPolyline;
pEnumVertex = pPtCollection.EnumVertices;
pEnumVertex.Reset();
//.........这里部分代码省略.........