本文整理汇总了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;未经允许,请勿转载。 |
请发表评论