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


C# IGeometryFactory.BuildGeometry方法代码示例

本文整理汇总了C#中IGeometryFactory.BuildGeometry方法的典型用法代码示例。如果您正苦于以下问题:C# IGeometryFactory.BuildGeometry方法的具体用法?C# IGeometryFactory.BuildGeometry怎么用?C# IGeometryFactory.BuildGeometry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IGeometryFactory的用法示例。


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

示例1: Buffer

        /// <summary>
        /// 
        /// </summary>
        /// <param name="g"></param>
        /// <param name="distance"></param>
        /// <returns></returns>
        public IGeometry Buffer(IGeometry g, double distance)
        {
            IPrecisionModel precisionModel = workingPrecisionModel;
            if (precisionModel == null)
                precisionModel = g.PrecisionModel;

            // factory must be the same as the one used by the input
            geomFact = g.Factory;

            OffsetCurveBuilder curveBuilder = new OffsetCurveBuilder(precisionModel, quadrantSegments);
            curveBuilder.EndCapStyle = endCapStyle;
            OffsetCurveSetBuilder curveSetBuilder = new OffsetCurveSetBuilder(g, distance, curveBuilder);

            IList bufferSegStrList = curveSetBuilder.GetCurves();

            // short-circuit test
            if (bufferSegStrList.Count <= 0)
            {
                IGeometry emptyGeom = geomFact.CreateGeometryCollection(new IGeometry[0]);
                return emptyGeom;
            }

            ComputeNodedEdges(bufferSegStrList, precisionModel);
            graph = new PlanarGraph(new OverlayNodeFactory());
            graph.AddEdges(edgeList.Edges);

            IList subgraphList = CreateSubgraphs(graph);
            PolygonBuilder polyBuilder = new PolygonBuilder(geomFact);
            BuildSubgraphs(subgraphList, polyBuilder);
            IList resultPolyList = polyBuilder.Polygons;

            IGeometry resultGeom = geomFact.BuildGeometry(resultPolyList);
            return resultGeom;
        }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:40,代码来源:BufferBuilder.cs

示例2: Buffer

        public IGeometry Buffer(IGeometry g, double distance)
        {
            IPrecisionModel precisionModel = _workingPrecisionModel;
            if (precisionModel == null)
                precisionModel = g.PrecisionModel;

            // factory must be the same as the one used by the input
            _geomFact = g.Factory;

            OffsetCurveBuilder curveBuilder = new OffsetCurveBuilder(precisionModel, _bufParams);

            OffsetCurveSetBuilder curveSetBuilder = new OffsetCurveSetBuilder(g, distance, curveBuilder);

            var bufferSegStrList = curveSetBuilder.GetCurves();

            // short-circuit test
            if (bufferSegStrList.Count <= 0)
            {
                return CreateEmptyResultGeometry();
            }

            ComputeNodedEdges(bufferSegStrList, precisionModel);
            _graph = new PlanarGraph(new OverlayNodeFactory());
            _graph.AddEdges(_edgeList.Edges);

            IEnumerable<BufferSubgraph> subgraphList = CreateSubgraphs(_graph);
            PolygonBuilder polyBuilder = new PolygonBuilder(_geomFact);
            BuildSubgraphs(subgraphList, polyBuilder);
            var resultPolyList = polyBuilder.Polygons;

            // just in case...
            if (resultPolyList.Count <= 0)
            {
                return CreateEmptyResultGeometry();
            }

            IGeometry resultGeom = _geomFact.BuildGeometry(resultPolyList);
            return resultGeom;
        }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:39,代码来源:BufferBuilder.cs

示例3: ToNodedLines

        private IGeometry ToNodedLines(ICollection<ISegmentString> segStrings, IGeometryFactory geomFact)
        {
            var lines = new List<IGeometry>();
            foreach (NodedSegmentString nss in segStrings)
            {
                // skip collapsed lines
                if (nss.Count < 2)
                    continue;
                //Coordinate[] pts = getCoords(nss);
                var pts = nss.NodeList.GetSplitCoordinates();

                lines.Add(geomFact.CreateLineString(pts));
            }
            return geomFact.BuildGeometry(lines);
        }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:15,代码来源:GeometrySnapRounder.cs


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