当前位置: 首页>>代码示例>>C#>>正文


C# IGeometryCollection类代码示例

本文整理汇总了C#中IGeometryCollection的典型用法代码示例。如果您正苦于以下问题:C# IGeometryCollection类的具体用法?C# IGeometryCollection怎么用?C# IGeometryCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IGeometryCollection类属于命名空间,在下文中一共展示了IGeometryCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ClipGeometryCollection

        private static IGeometryCollection ClipGeometryCollection(IGeometryCollection geom, Envelope clipEnv)
        {
            var clipPoly = geom.Factory.ToGeometry(clipEnv);
            var clipped = new List<IGeometry>();
            for (var i = 0; i < geom.NumGeometries; i++)
            {
                var g = geom.GetGeometryN(i);
                IGeometry result = null;
                // don't clip unless necessary
                if (clipEnv.Contains(g.EnvelopeInternal))
                    result = g;
                else if (clipEnv.Intersects(g.EnvelopeInternal))
                {
                    result = clipPoly.Intersection(g);
                    // keep vertex key info
                    result.UserData = g.UserData;
                }

                if (result != null && !result.IsEmpty)
                {
                    clipped.Add(result);
                }
            }
            return geom.Factory.CreateGeometryCollection(GeometryFactory.ToGeometryArray(clipped));
        }
开发者ID:RoxyLalonde,项目名称:Phoenix-Realms,代码行数:25,代码来源:PolygonMap.cs

示例2: GeometryCollectionEnumerator

 /// <summary>
 /// Constructs an iterator over the given <c>GeometryCollection</c>.
 /// </summary>
 /// <param name="parent">
 /// The collection over which to iterate; also, the first
 /// element returned by the iterator.
 /// </param>
 public GeometryCollectionEnumerator(IGeometryCollection parent) 
 {
     this.parent = parent;
     atStart = true;
     index = 0;
     max = parent.NumGeometries;
 }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:14,代码来源:GeometryCollectionEnumerator.cs

示例3: WriteShape

 private static void WriteShape(IGeometryCollection geometries, string shapepath)
 {
     if (File.Exists(shapepath))
         File.Delete(shapepath);
     var sfw = new ShapefileWriter(geometries.Factory);
     sfw.Write(Path.GetFileNameWithoutExtension(shapepath), geometries);
 }
开发者ID:sridhar19091986,项目名称:sharpmapx,代码行数:7,代码来源:NetTopologySuiteShapeFileTests.cs

示例4: GeometryCollectionEnumerator

 /// <summary>
 /// Constructs an iterator over the given <c>GeometryCollection</c>.
 /// </summary>
 /// <param name="parent">
 /// The collection over which to iterate; also, the first
 /// element returned by the iterator.
 /// </param>
 public GeometryCollectionEnumerator(IGeometryCollection parent) 
 {
     _parent = parent;
     _atStart = true;
     _index = 0;
     _max = parent.NumGeometries;
 }
开发者ID:zhongshuiyuan,项目名称:mapwindowsix,代码行数:14,代码来源:GeometryCollectionEnumerator.cs

示例5: LoadSourceGeometries

 public void LoadSourceGeometries(IGeometryCollection geomColl)
 {
     for (int i = 0; i < geomColl.NumGeometries; i++)
     {
         IGeometry geom = geomColl.GetGeometryN(i);
         LoadVertices(geom.Coordinates, geom.UserData);
     }
 }
开发者ID:barentswatch,项目名称:NetTopologySuite,代码行数:8,代码来源:VertexTaggedGeometryDataMapper.cs

示例6: DoMerge

        private static IEnumerable<IGeometry> DoMerge(IGeometryCollection coll)
        {
            if (coll == null)
                throw new ArgumentNullException("coll");

            IEnumerable<IGeometry> items = GetItems(coll);
            yield return UnaryUnionOp.Union(items.ToArray());
        }
开发者ID:PedroMaitan,项目名称:sharpmap,代码行数:8,代码来源:ProcessController.cs

示例7: AddOutlineToGraphicsLayer3D

        public static void AddOutlineToGraphicsLayer3D(IGraphicsContainer3D graphicsContainer3D, IGeometryCollection geometryCollection, IColor color, esriSimple3DLineStyle style, double width)
        {
            for (int i = 0; i < geometryCollection.GeometryCount; i++)
            {
                IGeometry geometry = geometryCollection.get_Geometry(i);

                graphicsContainer3D.AddElement(ElementUtilities.ConstructPolylineElement(geometry, color, style, width));
            }
        }
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:9,代码来源:GraphicsLayer3DUtilities.cs

示例8: TestGraphBuilder2WithSampleGeometries

        /// <summary>
        /// Uses the passed geometry collection to generate a QuickGraph.
        /// </summary>
        /// <param name="edges"></param>
        /// <param name="src"></param>
        /// <param name="dst"></param>
        public ILineString TestGraphBuilder2WithSampleGeometries(IGeometryCollection edges, ICoordinate src, ICoordinate dst)
        {
            GraphBuilder2 builder = new GraphBuilder2(true);            
            foreach (IMultiLineString edge in edges.Geometries)
                foreach (ILineString line in edge.Geometries)                                
                    builder.Add(line);            
            builder.Initialize();

            return builder.Perform(src, dst);
        }
开发者ID:diegowald,项目名称:intellitrack,代码行数:16,代码来源:GraphBuilder2Test.cs

示例9: HasRepeatedPoint

 /// <summary>
 /// 
 /// </summary>
 /// <param name="gc"></param>
 /// <returns></returns>
 private bool HasRepeatedPoint(IGeometryCollection gc)
 {
     for (int i = 0; i < gc.NumGeometries; i++)
     {
         IGeometry g = gc.GetGeometryN(i);
         if (HasRepeatedPoint(g)) 
             return true;
     }
     return false;
 }
开发者ID:barentswatch,项目名称:NetTopologySuite,代码行数:15,代码来源:RepeatedPointTester.cs

示例10: TransformGeometryCollection

 /// <summary>
 /// Transforms a <see cref="IGeometryCollection" /> object.
 /// </summary>
 /// <param name="factory">The factory to create the new <see cref="IGeometryCollection"/></param>
 /// <param name="geoms">The input <see cref="IGeometryCollection"/></param>
 /// <param name="transform">The <see cref="IMathTransform"/></param>
 /// <returns>A transformed <see cref="IGeometryCollection"/></returns>
 public static IGeometryCollection TransformGeometryCollection(IGeometryFactory factory, 
     IGeometryCollection geoms, IMathTransform transform)
 {
     var geometries = geoms.Geometries;
     var coll = new List<IGeometry>(geometries.Length);
     foreach (var g in geometries)
     {
         var item = TransformGeometry(factory, g, transform);
         coll.Add(item);
     }
     return factory.CreateGeometryCollection(coll.ToArray());
 }
开发者ID:leoliusg,项目名称:NetTopologySuite,代码行数:19,代码来源:GeometryTransform.cs

示例11: Map

 /// <summary>
 ///
 /// </summary>
 /// <param name="gc"></param>
 /// <returns></returns>
 public IGeometryCollection Map(IGeometryCollection gc)
 {
     IList<IGeometry> mapped = new List<IGeometry>();
     for (var i = 0; i < gc.NumGeometries; i++)
     {
         var g = _mapOp(gc.GetGeometryN(i));
         if (!g.IsEmpty)
             mapped.Add(g);
     }
     return gc.Factory.CreateGeometryCollection(
         GeometryFactory.ToGeometryArray(mapped));
 }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:17,代码来源:GeometryCollectionMapper.cs

示例12: DoClean

        private static IEnumerable<IGeometry> DoClean(IGeometryCollection coll)
        {
            if (coll == null)
                throw new ArgumentNullException("coll");

            IEnumerable<IGeometry> items = GetItems(coll);
            foreach (IGeometry geom in items)
            {
                DouglasPeuckerSimplifier simplifier = new DouglasPeuckerSimplifier(geom);
                IGeometry clean = simplifier.GetResultGeometry();
                yield return clean;
            }
        }
开发者ID:PedroMaitan,项目名称:sharpmap,代码行数:13,代码来源:ProcessController.cs

示例13: ParseGeometryCollection

        public List<string> ParseGeometryCollection(IGeometryCollection geometryCollection)
        {
            var coords = new List<string>();

            //for each geometry in the collection
            for (int i = 0; i < geometryCollection.GeometryCount; i++)
            {
                var pGeom = geometryCollection.Geometry[i];
                var pntCollection = (IPointCollection)pGeom;

                for (var a = 0; a < pntCollection.PointCount; a++)
                {
                    var roundedPoint = Math.Round(pntCollection.Point[a].Y, 5) + " " + Math.Round(pntCollection.Point[a].X, 5);
                    //compare the point to the last one entered to make sure only unique points are entered
                    string lastPoint = "";
                    if (coords.Count > 1) lastPoint = coords[coords.Count - 1];
                    if (!lastPoint.Equals(roundedPoint)) coords.Add(roundedPoint);
                }
            }
            return coords;
        }
开发者ID:geoplex,项目名称:arcgis-exporter-extension,代码行数:21,代码来源:GeoRSSGeometry.cs

示例14: SetByteStreamLength

 /// <summary>
 /// 
 /// </summary>
 /// <param name="geometryCollection"></param>
 /// <returns></returns>
 protected int SetByteStreamLength(IGeometryCollection geometryCollection)
 {
     int count = InitValue;
     foreach (IGeometry g in geometryCollection.Geometries)
         count += SetByteStreamLength(g);
     return count;
 }
开发者ID:ste10k41,项目名称:nettopologysuite,代码行数:12,代码来源:GMLWriter.cs

示例15: Write

 /// <summary>
 /// 
 /// </summary>
 /// <param name="geometryCollection"></param>
 /// <param name="writer"></param>
 protected void Write(IGeometryCollection geometryCollection, XmlTextWriter writer)
 {
     writer.WriteStartElement("MultiGeometry", GMLElements.gmlNS);
     for (int i = 0; i < geometryCollection.NumGeometries; i++)
     {
         writer.WriteStartElement("geometryMember", GMLElements.gmlNS);
         Write(geometryCollection.Geometries[i], writer);
         writer.WriteEndElement();
     }
     writer.WriteEndElement();
 }
开发者ID:ste10k41,项目名称:nettopologysuite,代码行数:16,代码来源:GMLWriter.cs


注:本文中的IGeometryCollection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。