- 19
- 0
- 约8.94千字
- 约 9页
- 2017-06-10 发布于北京
- 举报
ArcEngine 中Geometry对象浅析
本帖最后由 shisanshao 于 2011-4-13 00:12 编辑 ArcEngine Geometry库定义了基本几何图形的矢量表达形式,顶级的几何图形有Points、Multipoints、Polylines、Polygons、 Multipatches,Geodatabase和绘图系统使用这些几何图形来定义其他各种形状的特征和图形,提供了编辑图形的操作方法和地图符号系统符号化特征数据的途径。 Geometry库中几个核心类和接口构成了Geometry对象的基本框架。 GeometryEnvironment提供了从不同的输入、设置或获取全局变量来创建几何图形的方法,以便控制geometry方法的行为。GeometryEnvironment对象是一个单例对象。以下为引用的内容:
public IPolyline TestGeometryEnvironment()
{
ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironmentClass();
//Create a projected coordinate system and define its domain, resolution, and x,y tolerance.
IspatialReferenceResolution spatialReferenceResolution = spatialReferenceFactory.CreateProjectedCoordinateSystem((int)esriSRProjCSType.esriSRProjCS_NAD1983UTM_11N) as ISpatialReferenceResolution;
spatialReferenceResolution.ConstructFromHorizon();
ISpatialReferenceTolerance spatialReferenceTolerance = spatialReferenceResolution as ISpatialReferenceTolerance;
spatialReferenceTolerance.SetDefaultXYTolerance();
ISpatialReference spatialReference = spatialReferenceResolution as ISpatialReference;
C
//Create an array of WKSPoint structures starting in the middle of the x,y domain of the
//projected coordinate system.
double xMin;
double xMax;
double yMin;
double yMax;
spatialReference.GetDomain(out xMin, out xMax, out yMin, out yMax);
double xFactor = (xMin + xMax) * 0.5;
double yFactor = (yMin + yMax) * 0.5;
WKSPoint[] wksPoints = new WKSPoint[10];
for (int i = 0; i wksPoints.Length; i++)
{
wksPoints.X = xFactor + i;
wksPoints.Y = yFactor + i;
}
IPointCollection4 pointCollection = new PolylineClass();
IGeometryBridge2 geometryBridge = new GeometryEnvironmentClass();
geometryBridge.AddWKSPoints(pointCollection, ref wksPoints);
IPolyline polyline = pointCollection as IPolyline;
polyline.SpatialReference = spatialReference;
return polyline;
}
复制代码
new GeometryEnvironmentClass仅仅是创建了一个指向已存在的GeometryEnvironmentClass的引用。注意 IGeometryBridge2接口的使用,addWKSPoints方法将WKSPoint二
您可能关注的文档
- abaqus错误警告集锦.doc
- ABB式形容词的注音.doc
- ABCA式、ABCB式、ABCC式、ABBC式重叠成语.doc
- ABCD级车的分级方法.doc
- abfcet2011人气最高的网名2011年最牛的qq网名.doc
- abfkyv家庭养花小技巧.doc
- abilitycapabilitycapacity等近义词辨析.doc
- Abs函数返回数的绝对值.doc
- ABS汽车配件改性造粒工艺设备方案(于).doc
- acad.fas病毒彻底处理的方法.doc
- 广东省广州省实验中学教育集团2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 广东省广州大学附属中学2025-2026学年八年级上学期奥班期中物理试题(解析版).docx
- 广东省广州市第八十六中学2025-2026学年八年级上学期期中物理试题(含答案).docx
- 广东省广州市第八十九中学2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 广东省广州市第二中学2025-2026学年八年级上学期期中考试物理试题(含答案).docx
- 广东省广州市第八十六中学2025-2026学年八年级上学期期中物理试题(解析版).docx
- 广东省广州市第八十九中学2025-2026学年八年级上学期期中考试物理试题(含答案).docx
- 广东省广州市第二中学2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 2026《中国人寿上海分公司营销员培训体系优化研究》18000字.docx
- 《生物探究性实验教学》中小学教师资格模拟试题.docx
原创力文档

文档评论(0)