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


C# ICoordinateSequence.Clone方法代码示例

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


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

示例1: Copy

 /// <summary> 
 /// Convenience method which provides statndard way of copying {CoordinateSequence}s
 /// </summary>
 /// <param name="seq">The sequence to copy.</param>
 /// <returns>A deep copy of the sequence.</returns>
 protected virtual ICoordinateSequence Copy(ICoordinateSequence seq)
 {
     return (ICoordinateSequence) seq.Clone();
 }
开发者ID:DIVEROVIEDO,项目名称:DotSpatial,代码行数:9,代码来源:GeometryTransformer.cs

示例2: Transform

 public override ICoordinateSequence Transform(ICoordinateSequence coordinateSequence)
 {
     var res = (ICoordinateSequence)coordinateSequence.Clone();
     foreach (var ct in _coordinateTransformationList)
     {
         res = ct.MathTransform.Transform(res);
     }
     return res;
 }
开发者ID:haoas,项目名称:ProjNet4GeoAPI,代码行数:9,代码来源:ConcatenatedTransform.cs

示例3: Transform

        public ICoordinateSequence Transform(ICoordinateSequence coordinateSequence)
        {
            //use shortcut if possible
            var sequence = coordinateSequence as DotSpatialAffineCoordinateSequence;
            if (sequence != null)
                return TransformDotSpatialAffine(sequence);

            var xy = new double[2*coordinateSequence.Count];
            double[] z = null;
            if (!double.IsNaN(coordinateSequence.GetOrdinate(0, Ordinate.Z)))
                z = new double[coordinateSequence.Count];

            var j = 0;
            for (var i = 0; i < coordinateSequence.Count; i++)
            {
                xy[j++] = coordinateSequence.GetOrdinate(i, Ordinate.X);
                xy[j++] = coordinateSequence.GetOrdinate(i, Ordinate.Y);
                if (z != null) z[i] = coordinateSequence.GetOrdinate(i, Ordinate.Z);
            }

            Reproject.ReprojectPoints(xy, z, Source, Target, 0, coordinateSequence.Count);

            var ret = (ICoordinateSequence) coordinateSequence.Clone();
            j = 0;
            for (var i = 0; i < coordinateSequence.Count; i++)
            {
                ret.SetOrdinate(i, Ordinate.X, xy[j++]);
                ret.SetOrdinate(i, Ordinate.Y, xy[j++]);
                if (z != null && DimTarget>2) 
                    ret.SetOrdinate(i, Ordinate.Z, z[i]);
                else 
                    ret.SetOrdinate(i,Ordinate.Z, coordinateSequence.GetOrdinate(i, Ordinate.Z));
            }

            return ret;
        }
开发者ID:ste10k41,项目名称:nettopologysuite,代码行数:36,代码来源:DotSpatialMathTransform.cs

示例4: Transform

 /// <summary>
 /// Transforms a coordinate sequence. The input coordinate sequence remains unchanged.
 /// </summary>
 /// <param name="coordinateSequence">The coordinate sequence to transform.</param>
 /// <returns>The transformed coordinate sequence.</returns>
 public ICoordinateSequence Transform(ICoordinateSequence coordinateSequence)
 {
     var c = (ICoordinateSequence)coordinateSequence.Clone();
     for (var i = 0; i < c.Count; i++)
         _affineTransformation.Transform(c, i);
     return c;
 }
开发者ID:ste10k41,项目名称:nettopologysuite,代码行数:12,代码来源:GeometryTransformTest.cs


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