• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IGeometryCollection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: AddCollection

 /// <summary>
 /// 
 /// </summary>
 /// <param name="gc"></param>
 private void AddCollection(IGeometryCollection gc)
 {
     for (int i = 0; i < gc.NumGeometries; i++)
     {
         IGeometry g = gc.GetGeometryN(i);
         Add(g);
     }
 }
开发者ID:zhongshuiyuan,项目名称:mapwindowsix,代码行数:12,代码来源:OffsetCurveSetBuilder.cs


示例17: EditGeometryCollection

        /// <summary>
        /// 
        /// </summary>
        /// <param name="collection"></param>
        /// <param name="operation"></param>
        /// <returns></returns>
        private IGeometryCollection EditGeometryCollection(IGeometryCollection collection, GeometryEditorOperation operation)
        {
            IGeometryCollection newCollection = (IGeometryCollection) operation.Edit(collection, factory);
            ArrayList geometries = new ArrayList();
            for (int i = 0; i < newCollection.NumGeometries; i++) 
            {
                IGeometry geometry = Edit(newCollection.GetGeometryN(i), operation);
                if (geometry.IsEmpty)  continue;
                geometries.Add(geometry);
            }

            if (newCollection is IMultiPoint) 
                return factory.CreateMultiPoint((IPoint[]) geometries.ToArray(typeof(IPoint)));

            if (newCollection is IMultiLineString) 
                return factory.CreateMultiLineString((ILineString[]) geometries.ToArray(typeof(ILineString)));

            if (newCollection is IMultiPolygon)
                return factory.CreateMultiPolygon((IPolygon[]) geometries.ToArray(typeof(IPolygon)));

            return factory.CreateGeometryCollection((IGeometry[]) geometries.ToArray(typeof(IGeometry)));
        }
开发者ID:DIVEROVIEDO,项目名称:DotSpatial,代码行数:28,代码来源:GeometryEditor.cs


示例18: SetByteStream

 /// <summary>
 ///
 /// </summary>
 /// <param name="geometry"></param>
 /// <returns></returns>
 protected virtual int SetByteStream(IGeometryCollection geometry)
 {
     int count = INIT_COUNT;
     count += 4;
     foreach (Geometry geom in geometry.Geometries)
         count += SetByteStream(geom);
     return count;
 }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:13,代码来源:WkbWriter.cs


示例19: Write

 /// <summary>
 ///
 /// </summary>
 /// <param name="geomCollection"></param>
 /// <param name="writer"></param>
 protected virtual void Write(IGeometryCollection geomCollection, BinaryWriter writer)
 {
     WriteByteOrder(writer);
     writer.Write((int)WkbGeometryType.GeometryCollection);
     writer.Write(geomCollection.NumGeometries);
     for (int i = 0; i < geomCollection.NumGeometries; i++)
         Write(geomCollection.Geometries[i], writer);
 }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:13,代码来源:WkbWriter.cs


示例20: TransformGeometryCollection

        /// <summary>
        /// Transforms a <see cref="GeoAPI.Geometries.IGeometryCollection"/>.
        /// </summary>
        /// <param name="geoms">GeometryCollection to transform</param>
        /// <param name="from">Source Projection</param>
        /// <param name="to">Target Projection</param>
        /// <param name="toFactory">The factory to create geometries for <paramref name="to"/></param>
        /// <returns>Transformed GeometryCollection</returns>
        public static IGeometryCollection TransformGeometryCollection(IGeometryCollection geoms, ProjectionInfo from, ProjectionInfo to, IGeometryFactory toFactory)
        {
            var gOut = new IGeometry[geoms.Count];
            for (var i = 0; i < geoms.Count; i++)
                gOut[i] = TransformGeometry(geoms.GetGeometryN(i), from, to, toFactory);

            return toFactory.CreateGeometryCollection(gOut);
        }
开发者ID:PedroMaitan,项目名称:sharpmap,代码行数:16,代码来源:GeometryTransformDotSpatial.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IGeometryFactory类代码示例发布时间:2022-05-24
下一篇:
C# IGeometry类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap