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

C# IMultiLineString类代码示例

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

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



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

示例1: ComputeBoundaryCoordinates

        //private Map endpointMap;

        private Coordinate[] ComputeBoundaryCoordinates(IMultiLineString mLine)
        {
            IList<Coordinate> bdyPts = new List<Coordinate>();
            _endpointMap = new OrderedDictionary<Coordinate, Counter>();
            for (int i = 0; i < mLine.NumGeometries; i++)
            {
                ILineString line = (ILineString)mLine.GetGeometryN(i);
                if (line.NumPoints == 0)
                    continue;
                AddEndpoint(line.GetCoordinateN(0));
                AddEndpoint(line.GetCoordinateN(line.NumPoints - 1));
            }

            foreach (KeyValuePair<Coordinate, Counter> entry in _endpointMap)
            {
                Counter counter = entry.Value;
                int valence = counter.Count;
                if (_bnRule.IsInBoundary(valence))
                {
                    bdyPts.Add(entry.Key);
                }
            }

            return CoordinateArrays.ToCoordinateArray(bdyPts);
        }
开发者ID:ste10k41,项目名称:nettopologysuite,代码行数:27,代码来源:BoundaryOp.cs


示例2: DrawMultiLineString

 public static void DrawMultiLineString(D2D1.RenderTarget renderTarget, D2D1.Factory factory, IMultiLineString lines, D2D1.Brush pen, float penWidth, D2D1.StrokeStyle penStrokeStyle, Map map, float offset)
 {
     for (var i = 0; i < lines.NumGeometries; i++)
     {
         var line = (ILineString)lines[i];
         DrawLineString(renderTarget, factory, line, pen, penWidth, penStrokeStyle, map, offset);
     }
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:8,代码来源:SharpDXVectorRenderer.cs


示例3: DrawMultiLineString

 public static void DrawMultiLineString(Graphics g, IMultiLineString lines, Pen pen, Map map, float offset)
 {
     for(var i = 0; i < lines.NumGeometries; i++)
     {
         var line = (ILineString) lines[i];
         DrawLineString(g, line, pen, map, offset);
     }
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:8,代码来源:VectorRenderer.cs


示例4: GeometryToSqlGeometry

        private static void GeometryToSqlGeometry(IMultiLineString geom, SqlGeometryBuilder bldr)
        {
            bldr.BeginGeometry(OpenGisGeometryType.MultiLineString);

            for (int i = 0, c = geom.NumGeometries; i < c; i++)
                GeometryToSqlGeometry(geom.Geometries[i] as ILineString, bldr);

            bldr.EndGeometry();
        }
开发者ID:interworks,项目名称:FastShapefile,代码行数:9,代码来源:ConvertToSqlGeometry.cs


示例5: BoundaryMultiLineString

        private IGeometry BoundaryMultiLineString(IMultiLineString mLine)
        {
            if (_geom.IsEmpty)
            {
                return GetEmptyMultiPoint();
            }

            Coordinate[] bdyPts = ComputeBoundaryCoordinates(mLine);

            // return Point or MultiPoint
            if (bdyPts.Length == 1)
            {
                return _geomFact.CreatePoint(bdyPts[0]);
            }
            // this handles 0 points case as well
            return _geomFact.CreateMultiPoint(bdyPts);
        }
开发者ID:ste10k41,项目名称:nettopologysuite,代码行数:17,代码来源:BoundaryOp.cs


示例6: SetByteStream

        /// <summary>
        /// 
        /// </summary>
        /// <param name="geometry"></param>
        /// <returns></returns>
        protected int SetByteStream(IMultiLineString geometry)
        {
			// 4-byte count + subgeometries
			return 4 + SetByteStream(geometry.Geometries);
		}
开发者ID:lishxi,项目名称:_SharpMap,代码行数:10,代码来源:PostGisWriter.cs


示例7: Write

 /// <summary>
 /// 
 /// </summary>
 /// <param name="multiLineString"></param>
 /// <param name="writer"></param>
 protected void Write(IMultiLineString multiLineString, BinaryWriter writer)
 {
     WriteByteOrder(writer);     // LittleIndian
     writer.Write((int) WKBGeometryTypes.WKBMultiLineString);
     writer.Write((int) multiLineString.NumGeometries);
     for (int i = 0; i < multiLineString.NumGeometries; i++)
         Write(multiLineString.Geometries[i] as ILineString, writer);
 }
开发者ID:izambakci,项目名称:tf-net,代码行数:13,代码来源:WKBWriter.cs


示例8: SetByteStreamLength

 /// <summary>
 /// 
 /// </summary>
 /// <param name="multiLineString"></param>
 /// <returns></returns>
 protected int SetByteStreamLength(IMultiLineString multiLineString)
 {            
     int numParts = multiLineString.NumGeometries;
     int numPoints = multiLineString.NumPoints;
     return CalculateLength(numParts, numPoints);
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:11,代码来源:ShapeWriter.cs


示例9: SetByteStreamLength

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


示例10: IsSimple

 public bool IsSimple(IMultiLineString geom)
 {
     return IsSimpleLinearGeometry(geom);
 }
开发者ID:jaundice,项目名称:NetTopologySuite,代码行数:4,代码来源:IsSimpleOp.cs


示例11: Write

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


示例12: FromMultiLineString

        private static GeoAPIMultiLineString FromMultiLineString(IMultiLineString geometry, GeoAPIGeometryFactory factory, bool copyUserData)
        {
            var dsLineStrings = new GeoAPILineString[geometry.NumGeometries];

            for (var i = 0; i < dsLineStrings.Length; i++)
                dsLineStrings[i] = FromLineString((ILineString)geometry.GetGeometryN(i), factory, copyUserData);

            var result = factory.CreateMultiLineString(dsLineStrings);
            if (copyUserData)
                result.UserData = geometry.UserData;
            return result;
        }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:12,代码来源:GeometryConverterToGeoAPI.cs


示例13: Write

        /// <summary>
        /// Method to write a multi linestring geometry to the <paramref name="writer"/>
        /// </summary>
        /// <param name="lines">The multi linestring geometry</param>
        /// <param name="writer">The JSON writer</param>
        public static void Write(IMultiLineString lines, TextWriter writer)
        {
            if (lines == null)
                return;
            if (writer == null)
                throw new ArgumentNullException("writer", "A valid text writer object is required");

            Write(lines, CreateWriter(writer));
        }
开发者ID:geobabbler,项目名称:SharpMap,代码行数:14,代码来源:GeoJSONWriter.cs


示例14: Write

 /// <summary>
 /// 
 /// </summary>
 /// <param name="multiLineString"></param>
 /// <param name="writer"></param>
 protected void Write(IMultiLineString multiLineString, BinaryWriter writer)
 {
     WriteByteOrder(writer);     // LittleIndian
     if (Double.IsNaN(multiLineString.Coordinate.Z))
          writer.Write((int)WKBGeometryTypes.WKBMultiLineString);
     else writer.Write((int)WKBGeometryTypes.WKBMultiLineStringZ);
     writer.Write((int) multiLineString.NumGeometries);
     for (int i = 0; i < multiLineString.NumGeometries; i++)
         Write(multiLineString.Geometries[i] as ILineString, writer);
 }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:15,代码来源:WKBWriter.cs


示例15: WriteMultiLineString

        /// <summary>
        /// Writes a multilinestring.
        /// </summary>
        /// <param name="mls">The multilinestring to be written.</param>
        /// <param name="bWriter">Stream to write to.</param>
        /// <param name="byteorder">Byte order</param>
        private static void WriteMultiLineString(IMultiLineString mls, BinaryWriter bWriter, WkbByteOrder byteorder)
        {
            //Write the number of linestrings.
            int num = mls.NumGeometries;
            WriteUInt32((uint) num, bWriter, byteorder);

            //Loop on the number of linestrings. 
            //NOTE: by contract, the first item returned 
            //      from GetEnumerator (i.e. using foreach) is the IMultiLineString itself!
            for (int i = 0; i < num; i++)
            {
                ILineString ls = (ILineString) mls.GetGeometryN(i);
                //Write LineString Header
                bWriter.Write((byte)byteorder);
                WriteUInt32((uint)WKBGeometryType.wkbLineString, bWriter, byteorder);
                //Write each linestring.
                WriteLineString(ls, bWriter, byteorder);
            }
        }
开发者ID:geobabbler,项目名称:SharpMap,代码行数:25,代码来源:GeometryToWKB.cs


示例16: TransformMultiLineString

        /// <summary>
        /// Transforms a <see cref="GeoAPI.Geometries.IMultiLineString"/>.
        /// </summary>
        /// <param name="lines">MultiLineString 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 MultiLineString</returns>
        public static IMultiLineString TransformMultiLineString(IMultiLineString lines, ProjectionInfo from, ProjectionInfo to, IGeometryFactory toFactory)
        {
            var l = new ILineString[lines.Count];
            for (var i = 0; i < lines.Count; i++)
                l[i] = TransformLineString((ILineString)lines.GetGeometryN(i), from, to, toFactory);

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


示例17: FromMultiLineString

        private static DSMultiLineString FromMultiLineString(IMultiLineString geometry, DSGeometryFactory factory, bool setUserData)
        {
            var dsLineStrings = new DotSpatial.Topology.IBasicLineString[geometry.NumGeometries];

            for (var i = 0; i < dsLineStrings.Length; i++)
                dsLineStrings[i] = FromLineString((ILineString)geometry.GetGeometryN(i), factory, setUserData);

            var result = factory.CreateMultiLineString(dsLineStrings);
            if (setUserData)
                result.UserData = geometry.UserData;
            return result;
        }
开发者ID:ste10k41,项目名称:nettopologysuite,代码行数:12,代码来源:GeometryConverterToDotSpatial.cs


示例18: SetByteStream

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


示例19: IsOnLine

        /// <summary>
        /// Determines whether specific Coordinate in on the given multiline.
        /// </summary>
        /// <param name="c">The coordinate to check.</param>
        /// <param name="multiline">The multiline to check coordinate against.</param>
        /// <returns>true if coordinate lies on any line of the given multiline, otherwise false.</returns>
        public bool IsOnLine(Coordinate c, IMultiLineString multiline)
        {
            foreach (var line in multiline.Geometries) {
                if (this.IsOnLine(c, line)) {
                    return true;
                }
            }

            return false;
        }
开发者ID:najira,项目名称:spatiallite-net,代码行数:16,代码来源:Topology.cs


示例20: Write

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IMultiPoint类代码示例发布时间:2022-05-24
下一篇:
C# IMove类代码示例发布时间: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