本文整理汇总了C#中IMathTransform.TransformList方法的典型用法代码示例。如果您正苦于以下问题:C# IMathTransform.TransformList方法的具体用法?C# IMathTransform.TransformList怎么用?C# IMathTransform.TransformList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMathTransform
的用法示例。
在下文中一共展示了IMathTransform.TransformList方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExtractCoordinates
/// <summary>
///
/// </summary>
/// <param name="ls"></param>
/// <param name="transform"></param>
/// <returns></returns>
private static ICoordinate[] ExtractCoordinates(IGeometry ls, IMathTransform transform)
{
List<double[]> points = new List<double[]>(ls.NumPoints);
foreach (ICoordinate c in ls.Coordinates)
points.Add(ToArray(c.X, c.Y));
points = transform.TransformList(points);
List<ICoordinate> coords = new List<ICoordinate>(points.Count);
foreach (double[] p in points)
coords.Add(new Coordinate(p[0], p[1]));
return coords.ToArray();
}
示例2: TransformMultiPoint
/// <summary>
/// Transforms a <see cref="MultiPoint" /> object.
/// </summary>
/// <param name="points"></param>
/// <param name="transform"></param>
/// <returns></returns>
public static IMultiPoint TransformMultiPoint(IMultiPoint points, IMathTransform transform)
{
List<double[]> pointList = new List<double[]>(points.Geometries.Length);
foreach (IPoint p in points.Geometries)
pointList.Add(ToArray(p.X, p.Y));
pointList = transform.TransformList(pointList);
IPoint[] array = new IPoint[pointList.Count];
for (int i = 0; i < pointList.Count; i++)
array[i] = ToNTS(pointList[i][0], pointList[i][1]);
return new MultiPoint(array);
}
示例3: TransformLineString
/// <summary>
/// Transforms a <see cref="SharpMap.Geometries.LineString"/>.
/// </summary>
/// <param name="l">LineString to transform</param>
/// <param name="transform">MathTransform</param>
/// <returns>Transformed LineString</returns>
public static LineString TransformLineString(LineString l, IMathTransform transform)
{
try { return new LineString(transform.TransformList(l.Vertices)); }
catch { return null; }
}
示例4: TransformLinearRing
/// <summary>
/// Transforms a <see cref="SharpMap.Geometries.LinearRing"/>.
/// </summary>
/// <param name="r">LinearRing to transform</param>
/// <param name="transform">MathTransform</param>
/// <returns>Transformed LinearRing</returns>
public static LinearRing TransformLinearRing(LinearRing r, IMathTransform transform)
{
try { return new LinearRing(transform.TransformList(r.Vertices)); }
catch { return null; }
}
示例5: ExtractCoordinates
/// <summary>
///
/// </summary>
/// <param name="ls"></param>
/// <param name="transform"></param>
/// <returns></returns>
private static List<ICoordinate> ExtractCoordinates(ILineString ls, IMathTransform transform)
{
List<double[]> points =
new List<double[]>(ls.NumPoints);
foreach (ICoordinate c in ls.Coordinates)
points.Add(ToLightStruct(c.X, c.Y));
points = transform.TransformList(points);
List<ICoordinate> coords = new List<ICoordinate>(points.Count);
foreach (double[] p in points)
coords.Add(GeometryFactory.CreateCoordinate(p[0], p[1]));
return coords;
}
示例6: TransformMultiPoint
/// <summary>
/// Transforms a <see cref="SharpMap.Geometries.MultiPoint"/>.
/// </summary>
/// <param name="points">MultiPoint to transform</param>
/// <param name="transform">MathTransform</param>
/// <returns>Transformed MultiPoint</returns>
public static MultiPoint TransformMultiPoint(MultiPoint points, IMathTransform transform)
{
List<double[]> pts = new List<double[]>();
for (int i = 0; i < points.NumGeometries; i++)
pts.Add(new double[2] {points[i].X, points[i].Y});
return new MultiPoint(transform.TransformList(pts));
}
示例7: TransformLinearRing
/// <summary>
/// Transforms a <see cref="SharpMap.Geometries.LinearRing"/>.
/// </summary>
/// <param name="r">LinearRing to transform</param>
/// <param name="transform">MathTransform</param>
/// <returns>Transformed LinearRing</returns>
public static LinearRing TransformLinearRing(LinearRing r, IMathTransform transform)
{
try
{
List<double[]> points = new List<double[]>();
for (int i = 0; i < r.Vertices.Count; i++)
points.Add(new double[2] {r.Vertices[i].X, r.Vertices[i].Y});
return new LinearRing(transform.TransformList(points));
}
catch
{
return null;
}
}
示例8: TransformMultiPoint
/// <summary>
/// Transforms a <see cref="SharpMap.Geometries.MultiPoint"/>.
/// </summary>
/// <param name="points">MultiPoint to transform</param>
/// <param name="transform">MathTransform</param>
/// <returns>Transformed MultiPoint</returns>
public static MultiPoint TransformMultiPoint(MultiPoint points, IMathTransform transform)
{
MultiPoint pOut = new MultiPoint();
pOut.Points = transform.TransformList(points.Points);
return pOut;
}
示例9: TransformLinePath
/// <summary>
/// Transforms coordinates of the line path.
/// </summary>
/// <param name="linePath">Line path to transform</param>
/// <param name="transform">The transformation to apply</param>
/// <returns>The transformed line path</returns>
public static LinePath TransformLinePath(LinePath linePath, IMathTransform transform)
{
List<double[]> points = new List<double[]>();
for (int i = 0; i < linePath.Vertices.Count; i++)
points.Add(new double[2] { linePath.Vertices[i].X, linePath.Vertices[i].Y });
return new LinePath(transform.TransformList(points));
}
示例10: TransformContour
/// <summary>
/// Transforms coordinates of the contour.
/// </summary>
/// <param name="contour">Contour to transform</param>
/// <param name="transform">The transformation to apply</param>
/// <returns>The transformed contour</returns>
public static Contour TransformContour(Contour contour, IMathTransform transform)
{
List<double[]> points = new List<double[]>();
for (int i = 0; i < contour.Vertices.Count; i++)
points.Add(new double[2] { contour.Vertices[i].X, contour.Vertices[i].Y });
return new Contour(transform.TransformList(points));
}
示例11: TransformMultiPoint
/// <summary>
/// Transforms coordinates of the multipoint.
/// </summary>
/// <param name="multiPoint">Multipoint to transform</param>
/// <param name="transform">The transformation to apply</param>
/// <returns>The transformed multipoint</returns>
public static MultiPoint TransformMultiPoint(MultiPoint multiPoint, IMathTransform transform)
{
List<double[]> points = new List<double[]>();
for (int i = 0; i < multiPoint.Points.Count; i++)
points.Add(new double[2] { multiPoint.Points[i].X, multiPoint.Points[i].Y });
return new MultiPoint(transform.TransformList(points));
}