/// <summary>
/// 将面状图层的圆弧转为加密的线段
/// </summary>
/// <param name="pWorkspace">工作空间(FileGDB)</param>
/// <param name="sPolygonFeatureClassName">面状要素类名称</param>
/// <param name="nSegLength">加密线段每段的参考长度</param>
private static void CircularArcToDensifiedLines(IFeatureWorkspace pWorkspace, string sPolygonFeatureClassName, int nSegLength = 10)
{
try
{
var pFeatureClass = pWorkspace.OpenFeatureClass(sPolygonFeatureClassName);
var pFeatureCursor = pFeatureClass.Search(null, false);
var bChange = false;
IFeature pFeature;
while (null != (pFeature = pFeatureCursor.NextFeature()))
{
var pGeoCol = pFeature.ShapeCopy as IGeometryCollection;
for (int i = pGeoCol.GeometryCount - 1; i >= 0; i--)
{
var pGeo = pGeoCol.Geometry[i];
if (pGeo.GeometryType == esriGeometryType.esriGeometryRing)
{
var pSegCol = pGeo as ISegmentCollection;
var nCount = pSegCol.SegmentCount;
for (int j = nCount - 1; j >= 0; j--)
{
var pSeg = pSegCol.Segment[j];
if (pSeg.GeometryType != esriGeometryType.esriGeometryCircularArc)
{
continue;
}
var pCircularArc = pSeg as ICircularArc;
var nLength = pCircularArc.Length;
var nShareCount = (int)(nLength / nSegLength) + 1;
if (nShareCount < 3)
{
nShareCount = 3;
}
int nNum = 0;
var lstLine = new ILine[nShareCount];
IGeometryBridge2 geometryBridge2 = new GeometryEnvironmentClass();
geometryBridge2.Densify(pSeg, 0.1, ref nNum, ref lstLine);
var pGeometryBag = new GeometryBagClass();
ISegmentCollection pGeometryCollection = new PolygonClass();
lstLine.ToList().ForEach(p => pGeometryCollection.AddSegment(p as ISegment));
bChange = true;
if (bChange)
{
pSegCol.RemoveSegments(j, 1, false);
pSegCol.InsertSegmentCollection(j, pGeometryCollection);
}
}
}
}
if (bChange)
{
pFeature.Shape = pGeoCol as IGeometry;
pFeature.Store();
}
}
}
catch { }
}
ArcGIS Engine将圆弧转为加密的线段
最新推荐文章于 2025-03-24 16:55:10 发布
该篇博客介绍了如何使用C#在GIS工作空间中,通过IFeatureWorkspace和几何操作,将特征类中的圆形弧段转换为指定长度的加密线段,提升数据精度并保持地理信息的准确性。
部署运行你感兴趣的模型镜像
您可能感兴趣的与本文相关的镜像
ACE-Step
音乐合成
ACE-Step
ACE-Step是由中国团队阶跃星辰(StepFun)与ACE Studio联手打造的开源音乐生成模型。 它拥有3.5B参数量,支持快速高质量生成、强可控性和易于拓展的特点。 最厉害的是,它可以生成多种语言的歌曲,包括但不限于中文、英文、日文等19种语言

7844

被折叠的 条评论
为什么被折叠?



