IGeometryCollection Interface

简介:

Come from ArcGIS Online IGeometryCollection Interface

 

Provides access to members that can be used for accessing, adding and removing individual geometries of a multi-part geometry (Multipoint, Polyline, Polygon, MultiPatch, and GeometryBag).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

A Collection of Geometry parts.  For Multipoints, Triangles, TriangleFans, and TriangleStrips, the Geometry parts are Points. For Polylines, the Geometry parts are Paths.  For Polygons, the Geometry parts are Rings.  For MultiPatches, the Geometry parts are Triangles, TriangleFans, TriangleStrips, or Rings.  For GeometryBags, the Geometry parts are any IGeometry object.

The GeometryCollection can be used to access, manipulate, add, insert, remove, and set specific parts of a composite geometry.

When To Use

If you are using a development language that does not support C style arrays, use IGeometryBridge instead. The IGeometryBridge interface solves that problem allowing you to pass safe arrays instead.

Members

Description

 

 

AddGeometries

Adds references to the specified geometries. This method is intended for internal use only.

 

AddGeometry

Adds a reference to the input geometry either at the end, or before, or after the specified index.

 

AddGeometryCollection

Adds references to geometries in the input collection.

 

GeometriesChanged

Tells this geometry collection that some of its geometries have been altered. Use this method on polylines, polygons and multipatches after directly editing one of its parts.

 

Geometry

A reference to the ith geometry.

 

GeometryCount

The number of geometries in this collection.

 

InsertGeometries

Inserts at the specified index references to some number of geometries in the input array. This method is intended for internal use only.

 

InsertGeometryCollection

Inserts at the specified index references to all if the geometries in the input collection.

 

QueryGeometries

Populates the array with references to a sub-sequence of geometries. This method is intended for internal use only.

 

RemoveGeometries

Removes references to some geometries from this collection.

 

SetGeometries

Replaces all geometries in the collection with the specified number of references to those in the input array. This method is intended for internal use only.

 

SetGeometryCollection

Replaces all geometries in the collection with references to geometries from the input collection.

 

CoClasses that implement IGeometryCollection

CoClasses and Classes

Description

GeoEllipse (esriDefenseSolutions)

Its a spheroidal ellipse.

GeometryBag

An ordered collection of objects that support the IGeometry interface.

GeoPolygon (esriDefenseSolutions)

Its a spheroidal polygon.

GeoPolyline (esriDefenseSolutions)

This is a spheroidal polyline.

MultiPatch

A collection of surface patches.

Multipoint

An ordered collection of points; optionally has measure, height and ID attributes.

Polygon

A collection of rings ordered by their containment relationship; optionally has measure, height and ID attributes.

Polyline

An ordered collection of paths; optionally has measure, height and ID attributes.

TriangleFan

A continuous 3D fan of triangles, where each triangle after the first shares an edge with the preceding triangle, and all triangles share a common pivot point.

Triangles

A collection of 3D triangles, where each consecutive triplet of vertices defines a new triangle

TriangleStrip

A continuous 3D strip of triangles, where each triangle after the first shares an edge with the preceding triangle.

Remarks

Every Geometry created within ArcGIS should be assigned a spatial reference. Always attach well-defined spatial references to new geometries. This improves processing efficiency, in particular, when using ITopologicalOperator on geometries that contain curved segments (circular arcs, bezier curves, elliptical arcs). New geometries include any geometry that is created in memory. It does not matter whether it will be stored in a feature class or not. Well-defined as applied to a spatial reference means that it not only has its coordinate system (projection) defined, but also its coordinate grid. The coordinate grid consists of the xy domain, xy resolution, and xy cluster tolerance properties of a spatial reference. If the Geometry includes z or m values, the z or m domains, z or m resolutions, and z or m cluster tolerance properties must also be defined. The cluster tolerance and resolutions can be quickly and easily set using SetDefault methods on ISpatialReferenceResolution and ISpatialReferenceTolerance interfaces.

复制代码
//The example shows a GeometryCollection for MultiPoint.
public void ShowGeometries()
{

    IGeometryCollection geometryCollection = new MultipointClass();
    //add 10 points in a loop
    object missing = Type.Missing;

    for (int i = 0; i < 10; i++)
    {
        IPoint point = new PointClass();
        point.PutCoords(i * 10, i * 2);
        geometryCollection.AddGeometry(point as IGeometry, ref missing, ref missing);
    }

    int geometryCount = geometryCollection.GeometryCount;
    System.Windows.Forms.MessageBox.Show("GeometryCount = " + geometryCount);

    for (int i = 0; i < geometryCount; i++)
    {
        IGeometry currentGeometry = geometryCollection.get_Geometry(i);
        IPoint point = currentGeometry as IPoint;

        //we know that there are IPoints only in the Geometrycollection.
        //But this is the safe and recommended way
        if (point != null)
        {
            System.Windows.Forms.MessageBox.Show("X = " + point.X + ", Y = " + point.Y);
        }

    }

}
复制代码

 

没有整理与归纳的知识,一文不值!高度概括与梳理的知识,才是自己真正的知识与技能。 永远不要让自己的自由、好奇、充满创造力的想法被现实的框架所束缚,让创造力自由成长吧! 多花时间,关心他(她)人,正如别人所关心你的。理想的腾飞与实现,没有别人的支持与帮助,是万万不能的。


   本文转自wenglabs博客园博客,原文链接:http://www.cnblogs.com/arxive/p/6120217.html ,如需转载请自行联系原作者


相关文章
|
2天前
|
存储 关系型数据库 分布式数据库
PostgreSQL 18 发布,快来 PolarDB 尝鲜!
PostgreSQL 18 发布,PolarDB for PostgreSQL 全面兼容。新版本支持异步I/O、UUIDv7、虚拟生成列、逻辑复制增强及OAuth认证,显著提升性能与安全。PolarDB-PG 18 支持存算分离架构,融合海量弹性存储与极致计算性能,搭配丰富插件生态,为企业提供高效、稳定、灵活的云数据库解决方案,助力企业数字化转型如虎添翼!
|
13天前
|
弹性计算 关系型数据库 微服务
基于 Docker 与 Kubernetes(K3s)的微服务:阿里云生产环境扩容实践
在微服务架构中,如何实现“稳定扩容”与“成本可控”是企业面临的核心挑战。本文结合 Python FastAPI 微服务实战,详解如何基于阿里云基础设施,利用 Docker 封装服务、K3s 实现容器编排,构建生产级微服务架构。内容涵盖容器构建、集群部署、自动扩缩容、可观测性等关键环节,适配阿里云资源特性与服务生态,助力企业打造低成本、高可靠、易扩展的微服务解决方案。
1283 5
|
12天前
|
机器学习/深度学习 人工智能 前端开发
通义DeepResearch全面开源!同步分享可落地的高阶Agent构建方法论
通义研究团队开源发布通义 DeepResearch —— 首个在性能上可与 OpenAI DeepResearch 相媲美、并在多项权威基准测试中取得领先表现的全开源 Web Agent。
1312 87
|
1天前
|
弹性计算 安全 数据安全/隐私保护
2025年阿里云域名备案流程(新手图文详细流程)
本文图文详解阿里云账号注册、服务器租赁、域名购买及备案全流程,涵盖企业实名认证、信息模板创建、域名备案提交与管局审核等关键步骤,助您快速完成网站上线前的准备工作。
171 82
2025年阿里云域名备案流程(新手图文详细流程)
|
1天前
|
自然语言处理 前端开发
基于Electron38+Vite7.1+Vue3+Pinia3+ElementPlus电脑端admin后台管理模板
基于最新版跨平台框架Electron38整合Vite7+Vue3+ElementPlus搭建轻量级客户端中后台管理系统解决方案。
151 86