IGeometryCollection
IGeometryCollection 接口被 Polygon,Polyline, Multipoint, Multipatch, Trangle,Trangle Strip,Trangle Fan 和 GeometryBag 所實現(xiàn)。
Geometry 屬性
通過一個索引值返回一個組成該幾何對象的某個子對象。
GeometryCount 屬性
返回組成該幾何對象的子對象的數(shù)目。
AddGeometry 方法
向一個幾何對象添加一個幾何對象,將子對象添加到幾何的指定索引值的位置。
AddGeometries 方法
向一個幾何對象添加多個幾何對象,將子對象數(shù)組添加到集合的最后。
在使用 AddGeometry 方法添加子對象到 Polygon 對象的過程中,如果子對象即 Ring 出現(xiàn)覆蓋現(xiàn)象,那么多邊形就沒有封閉或出現(xiàn)了包含關系,那么這個 Polygon 就不是簡單 Polygon,因此通過 IGometryCollection 來創(chuàng)建一個 Polygon 時,需要使用 ITopologicalOperator 的 Simplify 方法保證其有效性
private IPolygon ConstructorPolygon(List<IRing> pRingList) { try { IGeometryCollection pGCollection = new PolygonClass(); object o = Type.Missing; for (int i = 0; i < pRingList.Count; i++) { // 通過IGeometryCollection接口的AddGeometry方法向Polygon對象中添加Ring子對象 pGCollection.AddGeometry(pRingList[i], ref o, ref o); } // QI至ITopologicalOperator ITopologicalOperator pTopological = pGCollection as ITopologicalOperator; // 執(zhí)行Simplify操作 pTopological.Simplify(); IPolygon pPolygon = pGCollection as IPolygon; //返回Polygon對象 return pPolygon; } catch (Exception Err) { return null; } }
private IPolygon MergePolygons(IPolygon FirstPolygon, IPolygon SecondPolygon) { try { // 創(chuàng)建一個Polygon對象 IGeometryCollection pGCollection1 = new PolygonClass(); IGeometryCollection pGCollection2 = FirstPolygon as IGeometryCollection; IGeometryCollection pGCollection3 = SecondPolygon as IGeometryCollection; // 添加FirstPolygon pGCollection1.AddGeometryCollection(pGCollection2); // 添加SecondPolygon pGCollection1.AddGeometryCollection(pGCollection3); // QI至ITopologicalOperator ITopologicalOperator pTopological = pGCollection1 as ITopologicalOperator; // 執(zhí)行Simplify操作 pTopological.Simplify(); //返回Polygon對象 IPolygon pPolygon = pGCollection1 as IPolygon; return pPolygon; } catch (Exception Err) { return null; } }
ISegmentCollection
ISegmentCollection 接口被 Path, Ring, Polyline 和 Polygon 四個類實現(xiàn)。
IPointCollection
ISegmentCollection 可以被多個幾個對象類所實現(xiàn),如 Multipoint, Path, Ring, Polyline, Polygon, Trangle,Trangle Strip,Trangle Fan, Multipatch.
另外有需要云服務器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。
網(wǎng)站題目:Geometry集合接口-創(chuàng)新互聯(lián)
網(wǎng)頁地址:http://vcdvsql.cn/article26/hdscg.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供手機網(wǎng)站建設、ChatGPT、定制網(wǎng)站、企業(yè)建站、網(wǎng)頁設計公司、品牌網(wǎng)站設計
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容