可用类型的几何对象esriGeometryType Constants

The available kinds of geometry objects.

ConstantValueDescription
esriGeometryNull0A geometry of unknown type.
esriGeometryPoint1A single zero dimensional geometry.
esriGeometryMultipoint2An ordered collection of points.
esriGeometryLine13A straight line segment between two points.
esriGeometryCircularArc14A portion of the boundary of a circle.
esriGeometryEllipticArc16A portion of the boundary of an ellipse.
esriGeometryBezier3Curve15A third degree bezier curve (four control points).
esriGeometryPath6A connected sequence of segments.
esriGeometryPolyline3An ordered collection of paths.
esriGeometryRing11An area bounded by one closed path.
esriGeometryPolygon4A collection of rings ordered by their containment relationship.
esriGeometryEnvelope5A rectangle indicating the spatial extent of another geometry.
esriGeometryAny7Any of the geometry coclass types.
esriGeometryBag17A collection of geometries of arbitrary type.
esriGeometryMultiPatch9A collection of surface patches.
esriGeometryTriangleStrip18A surface patch of triangles defined by three consecutive points.
esriGeometryTriangleFan19A surface patch of triangles defined by the first point and two consecutive points.
esriGeometryRay20An infinite, one-directional line extending from an origin point.
esriGeometrySphere21A complete 3 dimensional sphere.
esriGeometryTriangles22A surface patch of triangles defined by non-overlapping sets of three consecutive points each.
Product Availability
Remarks

A list of the distinct types of geometries creatable geometries.  Every geometry object belongs to and is identified as exactly one of these types (With the exception of esriGeometryAny which is true for all valid geometries.).

esriGeometryNull          = Unknown type of geometry
esriGeometryPoint         = PointesriGeometryMultipoint    = Multipoint (Collection of Points)
esriGeometryLine          = Line         (Segment)
esriGeometryCircularArc   = CircularArc  (Segment)
esriGeometryEllipticArc   = EllipticArc  (Segment)
esriGeometryBezier3Curve  = BezierCurve  (Segment)
esriGeometryPath          = PathesriGeometryPolyline      = Polyline (Collection of Paths)
esriGeometryRing          = Ring (Ring / SurfacePatch)
esriGeometryPolygon       = Polygon  (Collection of Rings)
esriGeometryEnvelope      = EnvelopeesriGeometryAny           = Any valid geometry
esriGeometryBag           = GeometryBag (Collection of Geometries)
esriGeometryMultiPatch    = MultiPatch  (Collection of SurfacePatches)
esriGeometryTriangleStrip = TriangleStrip (SurfacePatch)
esriGeometryTriangeFan    = TriangleFan   (SurfacePatch)
esriGeometryRay           = RayesriGeometrySphere        = SphereesriGeometryTriangles        = Triangles (SurfacePatch)

Geometry Types

 
 
[C#]

       publicstaticvoid GeometryToString(IGeometry geometry)

       {

           if (geometry == null)

           {

               Trace.WriteLine("Geometry Is Null.");

           }

           else

           {

               Trace.WriteLine("geometry.GeometryType = " + geometry.GeometryType);

 

               if (geometry.IsEmpty)

               {

                   Trace.WriteLine("Geometry Is Empty.");

               }

               else

               {

                   switch (geometry.GeometryType)

                   {

                       caseesriGeometryType.esriGeometryPoint:

 

                           IPoint point = geometry asIPoint;

                          

                           Trace.WriteLine("point = " + PointToString(point));

                          

                           break;

 

                       caseesriGeometryType.esriGeometryRay:

                          

                           IRay ray = geometry asIRay;

                          

                           Trace.WriteLine("ray.Origin = " + PointToString(ray.Origin));

                           Trace.WriteLine("ray.Vector.XComponent = " + ray.Vector.XComponent);

                           Trace.WriteLine("ray.Vector.YComponent = " + ray.Vector.YComponent);

                           Trace.WriteLine("ray.Vector.ZComponent = " + ray.Vector.ZComponent);

                           Trace.WriteLine("ray.Vector.Magnitude = " + ray.Vector.Magnitude);

                          

                           break;

 

                       caseesriGeometryType.esriGeometryLine:

                          

                           ILine line = geometry asILine;

                          

                           Trace.WriteLine("line.FromPoint = " + PointToString(line.FromPoint));

                           Trace.WriteLine("line.ToPoint = " + PointToString(line.ToPoint));

                          

                           break;

 

                       caseesriGeometryType.esriGeometryEnvelope:

                          

                           IEnvelope envelope = geometry asIEnvelope;

                          

                           Trace.WriteLine("envelope.XMin = " + envelope.XMin);

                           Trace.WriteLine("envelope.XMax = " + envelope.XMax);

                           Trace.WriteLine("envelope.YMin = " + envelope.YMin);

                           Trace.WriteLine("envelope.YMax = " + envelope.YMax);

                           Trace.WriteLine("envelope.ZMin = " + envelope.ZMin);

                           Trace.WriteLine("envelope.ZMax = " + envelope.ZMax);

                          

                           break;

 

                       caseesriGeometryType.esriGeometryPolyline:

 

                           IGeometryCollection geometryCollection = geometry asIGeometryCollection;

 

                           Trace.WriteLine("polyline.PathCount = " + geometryCollection.GeometryCount);

 

                           for (int i = 0; i < geometryCollection.GeometryCount; i++)

                           {

                               Trace.WriteLine("polyline.Path[" + i + "]");

 

                               IGeometry pathGeometry = geometryCollection.get_Geometry(i);

 

                               IPointCollection pathPointCollection = pathGeometry asIPointCollection;

 

                               for (int j = 0; j < pathPointCollection.PointCount; j++)

                               {

                                   Trace.WriteLine("Point[" + j + "] = " + PointToString(pathPointCollection.get_Point(j)));

                               }

                           }

 

                           break;

 

                       caseesriGeometryType.esriGeometryPolygon:

 

                           IPolygon4 polygon = geometry asIPolygon4;

 

                           IGeometryBag exteriorRingGeometryBag = polygon.ExteriorRingBag;

 

                           IGeometryCollection exteriorRingGeometryCollection = exteriorRingGeometryBag asIGeometryCollection;

 

                           Trace.WriteLine("polygon.ExteriorRingCount = " + exteriorRingGeometryCollection.GeometryCount);

 

                          for (int i = 0; i < exteriorRingGeometryCollection.GeometryCount; i++)

                           {

                               Trace.WriteLine("polygon.ExteriorRing[" + i + "]");

 

                               IGeometry exteriorRingGeometry = exteriorRingGeometryCollection.get_Geometry(i);

 

                               IPointCollection exteriorRingPointCollection = exteriorRingGeometry asIPointCollection;

 

                               for (int j = 0; j < exteriorRingPointCollection.PointCount; j++)

                               {

                                   Trace.WriteLine("Point[" + j + "] = " + PointToString(exteriorRingPointCollection.get_Point(j)));

                               }

 

                               IGeometryBag interiorRingGeometryBag = polygon.get_InteriorRingBag(exteriorRingGeometry asIRing);

 

                               IGeometryCollection interiorRingGeometryCollection = interiorRingGeometryBag asIGeometryCollection;

 

                               Trace.WriteLine("polygon.InteriorRingCount[exteriorRing" + i + "] = " + interiorRingGeometryCollection.GeometryCount);

 

                               for (int k = 0; k < interiorRingGeometryCollection.GeometryCount; k++)

                               {

                                   Trace.WriteLine("polygon.InteriorRing[" + k + "]");

 

                                   IGeometry interiorRingGeometry = interiorRingGeometryCollection.get_Geometry(k);

 

                                   IPointCollection interiorRingPointCollection = interiorRingGeometry asIPointCollection;

 

                                   for (int m = 0; m < interiorRingPointCollection.PointCount; m++)

                                   {

                                       Trace.WriteLine("Point[" + m + "] = " + PointToString(interiorRingPointCollection.get_Point(m)));

                                   }

                               }

                           }

 

                           break;

 

                       caseesriGeometryType.esriGeometryMultiPatch:

 

                           IGeometryCollection multiPatchGeometryCollection = geometry asIGeometryCollection;

 

                           Trace.WriteLine("multiPatch.PartCount = " + multiPatchGeometryCollection.GeometryCount);

 

                           for (int i = 0; i < multiPatchGeometryCollection.GeometryCount; i++)

                           {

                               IGeometry partGeometry = multiPatchGeometryCollection.get_Geometry(i);

 

                               Trace.WriteLine("multiPatch.Part[" + i + "].geometryType = " + partGeometry.GeometryType);

 

                               IPointCollection partPointCollection = partGeometry asIPointCollection;

 

                               for (int j = 0; j < partPointCollection.PointCount; j++)

                               {

                                   Trace.WriteLine("Point[" + j + "] = " + PointToString(partPointCollection.get_Point(j)));

                               }

                           }

 

                           break;

 

                       default:

 

                           IPointCollection pointCollection = geometry asIPointCollection;

 

                           for (int i = 0; i < pointCollection.PointCount; i++)

                           {

                               Trace.WriteLine("Point[" + i + "] = " + PointToString(pointCollection.get_Point(i)));

                           }

 

                           break;

                   }

               }

           }

 

           Trace.WriteLine(null);

       }

 

       privatestaticstring PointToString(IPoint point)

       {

           return (point.X + ", " + point.Y + ", " + point.Z);

转载于:https://www.cnblogs.com/qiushuixizhao/p/3242732.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值