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


C# IMultiLineString类代码示例

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


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


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