本文整理汇总了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();
}
示例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;
}
示例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;
}
示例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;
}