• 可用类型的几何对象esriGeometryType Constants


    The available kinds of geometry objects.

    ConstantValueDescription
    esriGeometryNull 0 A geometry of unknown type.
    esriGeometryPoint 1 A single zero dimensional geometry.
    esriGeometryMultipoint 2 An ordered collection of points.
    esriGeometryLine 13 A straight line segment between two points.
    esriGeometryCircularArc 14 A portion of the boundary of a circle.
    esriGeometryEllipticArc 16 A portion of the boundary of an ellipse.
    esriGeometryBezier3Curve 15 A third degree bezier curve (four control points).
    esriGeometryPath 6 A connected sequence of segments.
    esriGeometryPolyline 3 An ordered collection of paths.
    esriGeometryRing 11 An area bounded by one closed path.
    esriGeometryPolygon 4 A collection of rings ordered by their containment relationship.
    esriGeometryEnvelope 5 A rectangle indicating the spatial extent of another geometry.
    esriGeometryAny 7 Any of the geometry coclass types.
    esriGeometryBag 17 A collection of geometries of arbitrary type.
    esriGeometryMultiPatch 9 A collection of surface patches.
    esriGeometryTriangleStrip 18 A surface patch of triangles defined by three consecutive points.
    esriGeometryTriangleFan 19 A surface patch of triangles defined by the first point and two consecutive points.
    esriGeometryRay 20 An infinite, one-directional line extending from an origin point.
    esriGeometrySphere 21 A complete 3 dimensional sphere.
    esriGeometryTriangles 22 A 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);

  • 相关阅读:
    Java CountDownLatch应用
    servlet 表单
    servlet简单方法
    MySQL WHERE
    JavaScript typeof
    JavaScript字符串
    jsp语法
    HTML链接
    2021.3.10
    2021.3.9
  • 原文地址:https://www.cnblogs.com/qiushuixizhao/p/3242732.html
Copyright © 2020-2023  润新知