private static List <List <CPolygon> > GroupCpgsByOverlap(List <CPolygon> cpglt, PolyTree polyTree) { var GroupedCpgLtLt = new List <List <CPolygon> >(polyTree.ChildCount); var testCpgLt = cpglt; foreach (var nodePaths in GetOneLevelPathsEbFromPolyTree(polyTree)) { //overlap var remainCpgLt = new List <CPolygon>(testCpgLt.Count); var groupCpglt = new List <CPolygon>(); foreach (var testCpg in testCpgLt) { var clippedPaths = Clip_Paths(nodePaths, true, CHelpFunc.MakeLt(testCpg.ExteriorPath), true, ClipType.ctIntersection); if (clippedPaths == null || clippedPaths.Count == 0) { remainCpgLt.Add(testCpg); } else { groupCpglt.Add(testCpg); } } GroupedCpgLtLt.Add(groupCpglt); testCpgLt = remainCpgLt; } return(GroupedCpgLtLt); }
public static IFeatureLayer SaveCpl(CPolyline Cpl, string strFileName, List <string> pstrFieldNameLt = null, List <esriFieldType> pesriFieldTypeLt = null, List <List <object> > pobjectValueLtLt = null, int intRed = _intColor, int intGreen = _intColor, int intBlue = _intColor, double dblWidth = 1, int intOutlineRed = _intColor, int intOutlineGreen = _intColor, int intOutlineBlue = _intColor, string strSymbolLayerPath = null, bool blnVisible = true) { return(SaveCGeoEb(CHelpFunc.MakeLt(Cpl), esriGeometryType.esriGeometryPolyline, strFileName, pstrFieldNameLt, pesriFieldTypeLt, pobjectValueLtLt, intRed, intGreen, intBlue, dblWidth, intOutlineRed, intOutlineGreen, intOutlineBlue, esriSimpleFillStyle.esriSFSSolid, strSymbolLayerPath, blnVisible)); }
public static Paths DilateErodeOffsetCpgExterior_Paths(CPolygon Cpg, double dblGrow, double dblDilation, double dblErosion, string strBufferStyle, double dblMiterLimit) { double dblHoleIndicator = 1; if (Cpg.IsHole == true) { dblHoleIndicator = -1; } if (Cpg.ExteriorPath == null) { Cpg.SetExteriorPath(); } var overdilationPaths = Offset_Paths(CHelpFunc.MakeLt(Cpg.ExteriorPath), dblHoleIndicator * (dblGrow + dblDilation), strBufferStyle, dblMiterLimit); var erosionpaths = Offset_Paths(overdilationPaths, dblHoleIndicator * (-dblDilation - dblErosion), strBufferStyle, dblMiterLimit); //var ExteriorPath = GeneratePathByCpgExterior(Cpg); //var growndilationPaths = Offset_Paths(CHelpFunc.MakeLt(ExteriorPath), // dblHoleIndicator * (dblGrow ), strBufferStyle, dblMiterLimit); //var overdilationPaths = Offset_Paths(growndilationPaths, // dblHoleIndicator * (dblDilation), strBufferStyle, dblMiterLimit); //var backPaths = Offset_Paths(overdilationPaths, // dblHoleIndicator * (-dblDilation), strBufferStyle, dblMiterLimit); //var erosionpaths = Offset_Paths(backPaths, // dblHoleIndicator * (- dblErosion), strBufferStyle, dblMiterLimit); //CSaveFeature.SaveCpgEb(clipperMethods.ScaleCpgLt(CHelpFunc.MakeLt(Cpg), 1 / CConstants.dblFclipper), // "Cpg"); //// CSaveFeature.SaveCEdgeEb(clipperMethods.ScaleCEdgeEb(clipperMethods.ConvertPathsToCEdgeLt( ////growndilationPaths, true), 1 / CConstants.dblFclipper), "growndilationPaths", CConstants.ParameterInitialize); //CSaveFeature.SaveCEdgeEb(clipperMethods.ScaleCEdgeEb(clipperMethods.ConvertPathsToCEdgeLt(overdilationPaths, true), // 1 / CConstants.dblFclipper), "overdilationPaths"); //// CSaveFeature.SaveCEdgeEb(clipperMethods.ScaleCEdgeEb(clipperMethods.ConvertPathsToCEdgeLt( ////backPaths, true), 1 / CConstants.dblFclipper), "backPaths", CConstants.ParameterInitialize); //CSaveFeature.SaveCEdgeEb(clipperMethods.ScaleCEdgeEb(clipperMethods.ConvertPathsToCEdgeLt(erosionpaths, true), // 1 / CConstants.dblFclipper), "erosionpaths"); return(Offset_Paths(erosionpaths, dblHoleIndicator * dblErosion, strBufferStyle, dblMiterLimit)); }
public static PolyTree DilateErodeOffsetCpgExterior_PolyTree(CPolygon Cpg, double dblGrow, double dblDilation, double dblErosion, string strBufferStyle, double dblMiterLimit) { //dblDilation = dblDilation / 2; //dblErosion = dblGrow; //dblGrow = 0; //dblErosion = dblDilation; double dblHoleIndicator = 1; if (Cpg.IsHole == true) { dblHoleIndicator = -1; } if (Cpg.ExteriorPath == null) { Cpg.SetExteriorPath(); } var overdilationPaths = Offset_Paths(CHelpFunc.MakeLt(Cpg.ExteriorPath), dblHoleIndicator * (dblGrow + dblDilation), strBufferStyle, dblMiterLimit); var erosionpaths = Offset_Paths(overdilationPaths, dblHoleIndicator * (-dblDilation - dblErosion), strBufferStyle, dblMiterLimit); var normalPolyTree = Offset_PolyTree(erosionpaths, dblHoleIndicator * dblErosion, strBufferStyle, dblMiterLimit); //CSaveFeature.SavePathEbAsCpgEb(CHelpFunc.MakeLt(Cpg.ExteriorPath), // "originalpaths" , // pesriSimpleFillStyle: esriSimpleFillStyle.esriSFSNull, blnVisible: false); //CSaveFeature.SavePathEbAsCpgEb(overdilationPaths, // "overdilationPaths" + (dblGrow + dblDilation) / CConstants.dblFclipper + "m", // pesriSimpleFillStyle: esriSimpleFillStyle.esriSFSNull, blnVisible: false); //CSaveFeature.SavePathEbAsCpgEb(erosionpaths, // "erosionpaths" + (dblGrow - dblErosion) / CConstants.dblFclipper + "m", // pesriSimpleFillStyle: esriSimpleFillStyle.esriSFSNull, blnVisible: false); //CSaveFeature.SavePolyTreeAsCpgEb(normalPolyTree, // "normalPolyTree" + dblGrow / CConstants.dblFclipper + "m", // pesriSimpleFillStyle: esriSimpleFillStyle.esriSFSNull, blnVisible: false); return(normalPolyTree); }