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

C# ICoordinateSequence类代码示例

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

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



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

示例1: Reverse

 /// <summary>
 /// Reverses the coordinates in a sequence in-place.
 /// </summary>
 /// <param name="seq"></param>
 public static void Reverse(ICoordinateSequence seq)
 {
     int last = seq.Count - 1;
     int mid = last / 2;
     for (int i = 0; i <= mid; i++)
         Swap(seq, i, last - i);
 }
开发者ID:izambakci,项目名称:tf-net,代码行数:11,代码来源:CoordinateSequences.cs


示例2: Reproject

 public ICoordinateSequence Reproject(ICoordinateSequence sequence, ISpatialReference @from, ISpatialReference to)
 {
     double[] xy, z, m;
     ToDotSpatial(sequence, out xy, out z, out m);
     DotSpatial.Projections.Reproject.ReprojectPoints(xy, z, GetProjectionInfo(@from), GetProjectionInfo(to), 0, sequence.Count);
     return ToGeoAPI(DefaultSequenceFactory, xy, z, m);
 }
开发者ID:geobabbler,项目名称:SharpMap,代码行数:7,代码来源:DotSpatialReprojector.cs


示例3: Point

 /// <summary>
 /// Constructs a <c>Point</c> with the given coordinate.
 /// </summary>
 /// <param name="coordinates">
 /// Contains the single coordinate on which to base this <c>Point</c>,
 /// or <c>null</c> to create the empty point.
 /// </param>
 /// <param name="factory"></param>
 public Point(ICoordinateSequence coordinates, IGeometryFactory factory) : base(factory)
 {               
     if (coordinates == null) 
         coordinates = factory.CoordinateSequenceFactory.Create(new Coordinate[] { });
     NetTopologySuite.Utilities.Assert.IsTrue(coordinates.Count <= 1);
     this._coordinates = coordinates;
 }        
开发者ID:ste10k41,项目名称:nettopologysuite,代码行数:15,代码来源:Point.cs


示例4: Point

 /// <summary>
 /// Constructs a <c>Point</c> with the given coordinate.
 /// </summary>
 /// <param name="coordinates">
 /// Contains the single coordinate on which to base this <c>Point</c>,
 /// or <c>null</c> to create the empty point.
 /// </param>
 /// <param name="factory"></param>
 public Point(ICoordinateSequence coordinates, IGeometryFactory factory) : base(factory)
 {               
     if (coordinates == null) 
         coordinates = factory.CoordinateSequenceFactory.Create(new ICoordinate[] { });
     Debug.Assert(coordinates.Count <= 1);
     this.coordinates = (ICoordinateSequence) coordinates;
 }        
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:15,代码来源:Point.cs


示例5: Filter

 public void Filter(ICoordinateSequence seq, int i)
 {
     if (i == 0) return;
     seq.GetCoordinate(i - 1, p0);
     seq.GetCoordinate(i, p1);
     rcc.CountSegment(p0, p1);
 }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:7,代码来源:SimpleRayCrossingStressTest.cs


示例6: CoordinateArraySequence

 /// <summary>
 /// Constructs a sequence based on the given array (the array is not copied).
 /// </summary>
 /// <param name="coordSeq">The coordinate array that will be referenced.</param>      
 public CoordinateArraySequence(ICoordinateSequence coordSeq)
 {
     if (coordSeq != null)
          coordinates = new ICoordinate[coordSeq.Count];
     else coordinates = new ICoordinate[0];
     for (int i = 0; i < coordinates.Length; i++) 
         coordinates[i] = coordSeq.GetCoordinateCopy(i);
 }
开发者ID:DIVEROVIEDO,项目名称:DotSpatial,代码行数:12,代码来源:CoordinateArraySequence.cs


示例7: LineString

 /// <summary>
 /// 
 /// </summary>
 /// <param name="points">
 /// The points of the linestring, or <c>null</c>
 /// to create the empty point. Consecutive points may not be equal.
 /// </param>
 /// <param name="factory"></param>
 public LineString(ICoordinateSequence points, IGeometryFactory factory) : base(factory)
 {            
     if (points == null) 
         points = factory.CoordinateSequenceFactory.Create(new ICoordinate[] { });
     if (points.Count == 1)
         throw new ArgumentException("point array must contain 0 or >1 elements", "points");
     this.points = points;
 }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:16,代码来源:LineString.cs


示例8: ProjectToXY

 // ReSharper disable InconsistentNaming
 /// <summary>
 /// Creates a wrapper projecting to the XY plane.
 /// </summary>
 /// <param name="seq">The sequence to be projected</param>
 /// <returns>A sequence which projects coordinates</returns>
 public static ICoordinateSequence ProjectToXY(ICoordinateSequence seq)
 {
     /**
      * This is just a no-op, but return a wrapper
      * to allow better testing
      */
     return new AxisPlaneCoordinateSequence(seq, XYIndex);
 }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:14,代码来源:AxisPlaneCoordinateSequence.cs


示例9: CreateLinearRing

 private ILinearRing CreateLinearRing(ICoordinateSequence coordinates, bool ccw)
 {
     if (coordinates != null && Algorithm.CGAlgorithms.IsCCW(coordinates) != ccw)
     {
         //CoordinateSequences.Reverse(coordinates);
         coordinates = coordinates.Reversed();
     }
     return CreateLinearRing(coordinates);
 }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:9,代码来源:OgcCompliantGeometryFactory.cs


示例10: CopyToSequence

 private static ICoordinateSequence CopyToSequence(Coordinate[] coords, ICoordinateSequence sequence)
 {
     for (int i = 0; i < coords.Length; i++)
     {
         sequence.SetOrdinate(i, Ordinate.X, coords[i].X);
         sequence.SetOrdinate(i, Ordinate.Y, coords[i].Y);                
     }
     return sequence;
 }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:9,代码来源:Issue4Fixture.cs


示例11: Copy

		public static MCoordinate[] Copy(ICoordinateSequence coordSeq)
		{
			MCoordinate[] copy = new MCoordinate[coordSeq.Count];
			for (int i = 0; i < coordSeq.Count; i++)
			{
				copy[i] = new MCoordinate(coordSeq.GetCoordinate(i));
			}
			return copy;
		}
开发者ID:russcam,项目名称:Nhibernate.Spatial,代码行数:9,代码来源:MCoordinateSequence.cs


示例12: HasIntersectionWithLineStrings

 /// <summary>
 /// 
 /// </summary>
 /// <param name="seq"></param>
 /// <param name="lines"></param>
 /// <returns></returns>
 public bool HasIntersectionWithLineStrings(ICoordinateSequence seq, ICollection<IGeometry> lines)
 {
     foreach (ILineString line in lines)
     {
         HasIntersection(seq, line.CoordinateSequence);
         if (_hasIntersection)
             break;
     }
     return _hasIntersection;
 }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:16,代码来源:SegmentIntersectionTester.cs


示例13: CreateClosedRing

 private static ICoordinateSequence CreateClosedRing(ICoordinateSequenceFactory fact, ICoordinateSequence seq, int size)
 {
     var newseq = fact.Create(size, seq.Dimension);
     int n = seq.Count;
     Copy(seq, 0, newseq, 0, n);
     // fill remaining coordinates with start point
     for (int i = n; i < size; i++)
         Copy(seq, 0, newseq, i, 1);
     return newseq;
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:10,代码来源:GeoAPIEx.cs


示例14: CopyCoord

 ///<summary>
 /// Copies a coordinate of a <see cref="ICoordinateSequence"/> to another <see cref="ICoordinateSequence"/>.
 /// The sequences may have different dimensions;
 /// in this case only the common dimensions are copied.
 ///</summary>
 /// <param name="src">The sequence to copy coordinate from</param>
 /// <param name="srcPos">The index of the coordinate to copy</param>
 /// <param name="dest">The sequence to which the coordinate should be copied to</param>
 /// <param name="destPos">The index of the coordinate in <see paramref="dest"/></param>
 public static void CopyCoord(ICoordinateSequence src, int srcPos, ICoordinateSequence dest, int destPos)
 {
     int minDim = Math.Min(src.Dimension, dest.Dimension);
     for (int dim = 0; dim < minDim; dim++)
     {
         Ordinate ordinate = (Ordinate)dim;
         double value = src.GetOrdinate(srcPos, ordinate);
         dest.SetOrdinate(destPos, ordinate, value);
     }
 }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:19,代码来源:CoordinateSequences.cs


示例15: WriteInterval

        protected void WriteInterval(ICoordinateSequence sequence, Ordinate ordinate, BinaryWriter writer)
        {
            var val = GetOrdinate(sequence, ordinate, 0);
            var interval = Interval.Create(val);
            for (var i = 1; i < sequence.Count; i++)
                interval = interval.ExpandedByValue(GetOrdinate(sequence, ordinate, i));

            writer.Write(interval.Min);
            writer.Write(interval.Max);
        }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:10,代码来源:ShapeWriter.cs


示例16: Transform

 public PointF[] Transform(ICoordinateSequence modelSequence)
 {
     var res = new PointF[modelSequence.Count];
     for (var i = 0; i < modelSequence.Count; i++)
     {
         res[i] = Transform(modelSequence.GetOrdinate(0, Ordinate.X), 
                            modelSequence.GetOrdinate(0, Ordinate.Y));
     }
     return res;
 }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:10,代码来源:IdentityPointTransformation.cs


示例17: HasIntersectionWithLineStrings

 /// <summary>
 /// 
 /// </summary>
 /// <param name="seq"></param>
 /// <param name="lines"></param>
 /// <returns></returns>
 public bool HasIntersectionWithLineStrings(ICoordinateSequence seq, IList lines)
 {
     for (IEnumerator i = lines.GetEnumerator(); i.MoveNext(); ) 
     {
         ILineString line = (ILineString) i.Current;
         HasIntersection(seq, line.CoordinateSequence);
         if (hasIntersection)
             break;
     }
     return hasIntersection;
 }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:17,代码来源:SegmentIntersectionTester.cs


示例18: Swap

        /// <summary>
        /// Swaps two coordinates in a sequence.
        /// </summary>
        /// <param name="seq"></param>
        /// <param name="i"></param>
        /// <param name="j"></param>
        public static void Swap(ICoordinateSequence seq, int i, int j)
        {
            if (i == j)
                return;

            for (int dim = 0; dim < seq.Dimension; dim++)
            {
                double tmp = seq.GetOrdinate(i, (Ordinates)dim);
                seq.SetOrdinate(i, (Ordinates)dim, seq.GetOrdinate(j, (Ordinates)dim));
                seq.SetOrdinate(j, (Ordinates)dim, tmp);
            }
        }
开发者ID:izambakci,项目名称:tf-net,代码行数:18,代码来源:CoordinateSequences.cs


示例19: CoordinateArraySequence

        /// <summary>
        /// Creates a new sequence based on a deep copy of the given <see cref="ICoordinateSequence"/>.
        /// </summary>
        /// <param name="coordSeq">The coordinate sequence that will be copied</param>
        public CoordinateArraySequence(ICoordinateSequence coordSeq)
        {
            if (coordSeq == null)
            {
                Coordinates = new Coordinate[0];
                return;
            }

            _dimension = coordSeq.Dimension;
            Coordinates = new Coordinate[coordSeq.Count];

            for (var i = 0; i < Coordinates.Length; i++) 
                Coordinates[i] = coordSeq.GetCoordinateCopy(i);
        }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:18,代码来源:CoordinateArraySequence.cs


示例20: EnsureValidRing

        /// <summary>
        /// Ensures that a CoordinateSequence forms a valid ring, 
        /// returning a new closed sequence of the correct length if required.
        /// If the input sequence is already a valid ring, it is returned 
        /// without modification.
        /// If the input sequence is too short or is not closed, 
        /// it is extended with one or more copies of the start point.
        /// </summary>
        /// <param name="fact">The CoordinateSequenceFactory to use to create the new sequence</param>
        /// <param name="seq">The sequence to test</param>
        /// <returns>The original sequence, if it was a valid ring, or a new sequence which is valid.</returns>
        public static ICoordinateSequence EnsureValidRing(ICoordinateSequenceFactory fact, ICoordinateSequence seq)
        {
            var n = seq.Count;
            // empty sequence is valid
            if (n == 0) return seq;
            // too short - make a new one
            if (n <= 3)
                return CreateClosedRing(fact, seq, 4);

            var isClosed = Math.Abs(seq.GetOrdinate(0, Ordinate.X) - seq.GetOrdinate(n - 1, Ordinate.X)) < double.Epsilon &&
                           Math.Abs(seq.GetOrdinate(0, Ordinate.Y) - seq.GetOrdinate(n - 1, Ordinate.Y)) < double.Epsilon;
            if (isClosed) return seq;
            // make a new closed ring
            return CreateClosedRing(fact, seq, n + 1);
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:26,代码来源:GeoAPIEx.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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