C#Arcengine通過坐標點生成面(環形)


來自:http://www.cnblogs.com/lee24789229/p/5481978.html

通過傳入坐標點,返回幾何圖形,此代碼部分可以生成環形面。 

方法一

復制代碼
        private IGeometry getGeometry(IPointCollection Points) { IPointCollection iPointCollection = new PolygonClass(); Ring ring = new RingClass(); object missing = Type.Missing; ring.AddPointCollection(Points); IGeometryCollection pointPolygon = new PolygonClass(); pointPolygon.AddGeometry(ring as IGeometry, ref missing, ref missing); IPolygon polyGonGeo = pointPolygon as IPolygon; //polyGonGeo.Close();  polyGonGeo.SimplifyPreserveFromTo(); return polyGonGeo as IGeometry; }
復制代碼

方法二:

復制代碼
        private IGeometry getGeometry1(IPointCollection Points) { //IPointCollection iPointCollection = new PolygonClass(); object pMissing = Type.Missing; //iPointCollection.AddPointCollection(Points);  IGeometryCollection pGeoColl = Points as IGeometryCollection; ISegmentCollection pRing = new RingClass(); pRing.AddSegmentCollection(pGeoColl as ISegmentCollection); object miss = Type.Missing; IGeometryCollection pPolygon = new PolygonClass(); pPolygon.AddGeometry(pRing as IGeometry, ref miss, ref miss); ITopologicalOperator topologicalOperator = pPolygon as ITopologicalOperator; topologicalOperator.Simplify(); return pPolygon as IGeometry; }
復制代碼

 

本博客有部分內容來自網絡,如有問題請聯系QQ24789229,並注明來自博客園。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM