本文整理汇总了C#中IMultiPoint.GetGeometryN方法的典型用法代码示例。如果您正苦于以下问题:C# IMultiPoint.GetGeometryN方法的具体用法?C# IMultiPoint.GetGeometryN怎么用?C# IMultiPoint.GetGeometryN使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMultiPoint
的用法示例。
在下文中一共展示了IMultiPoint.GetGeometryN方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsSimple
/// <summary>
/// A MultiPoint is simple if it has no repeated points.
/// </summary>
public bool IsSimple(IMultiPoint mp)
{
if (mp.IsEmpty)
return true;
ISet points = new ListSet();
for (int i = 0; i < mp.NumGeometries; i++)
{
IPoint pt = (IPoint) mp.GetGeometryN(i);
ICoordinate p = pt.Coordinate;
if (points.Contains(p))
return false;
points.Add(p);
}
return true;
}
示例2: IsSimpleMultiPoint
private bool IsSimpleMultiPoint(IMultiPoint mp)
{
if (mp.IsEmpty)
return true;
HashSet<Coordinate> points = new HashSet<Coordinate>();
for (int i = 0; i < mp.NumGeometries; i++)
{
IPoint pt = (IPoint)mp.GetGeometryN(i);
Coordinate p = pt.Coordinate;
if (points.Contains(p))
{
_nonSimpleLocation = p;
return false;
}
points.Add(p);
}
return true;
}
示例3: AppendMultiPointText
/// <summary>
/// Converts a <c>MultiPoint</c> to <MultiPoint Text format, then
/// appends it to the writer.
/// </summary>
/// <param name="multiPoint">The <c>MultiPoint</c> to process.</param>
/// <param name="level"></param>
/// <param name="writer">The output writer to append to.</param>
private void AppendMultiPointText(IMultiPoint multiPoint, int level, TextWriter writer)
{
if (multiPoint.IsEmpty)
writer.Write(" EMPTY");
else
{
writer.Write("(");
for (int i = 0; i < multiPoint.NumGeometries; i++)
{
if (i > 0) writer.Write(",");
AppendCoordinate(((IPoint) multiPoint.GetGeometryN(i)).Coordinate, writer, multiPoint.PrecisionModel);
}
writer.Write(")");
}
}
示例4: TransformMultiPoint
/// <summary>
///
/// </summary>
/// <param name="geom"></param>
/// <param name="parent"></param>
/// <returns></returns>
protected virtual IGeometry TransformMultiPoint(IMultiPoint geom, IGeometry parent)
{
ArrayList transGeomList = new ArrayList();
for (int i = 0; i < geom.NumGeometries; i++)
{
IGeometry transformGeom = TransformPoint((IPoint) geom.GetGeometryN(i), geom);
if (transformGeom == null) continue;
if (transformGeom.IsEmpty) continue;
transGeomList.Add(transformGeom);
}
return factory.BuildGeometry(transGeomList);
}
示例5: GetByteStreamSize
/// <summary>
///
/// </summary>
/// <param name="geometry"></param>
/// <param name="coordinateSpace">The size needed for each coordinate</param>
/// <returns></returns>
private int GetByteStreamSize(IMultiPoint geometry, int coordinateSpace)
{
// int size
var result = 4;
if (geometry.NumPoints > 0)
{
// We can shortcut here, as all subgeoms have the same fixed size
result += geometry.NumPoints * GetByteStreamSize(geometry.GetGeometryN(0), coordinateSpace);
}
return result;
}
示例6: TransformMultiPoint
/// <summary>
/// Transforms a <see cref="MultiPoint" /> object.
/// </summary>
/// <param name="factory"></param>
/// <param name="points"></param>
/// <param name="transform"></param>
/// <returns></returns>
public static IMultiPoint TransformMultiPoint(IGeometryFactory factory,
IMultiPoint points, IMathTransform transform)
{
//We assume the first point holds all the ordinates
var firstPoint = (IPoint) points.GetGeometryN(0);
var ordinateFlags = firstPoint.CoordinateSequence.Ordinates;
var ordinates = OrdinatesUtility.ToOrdinateArray(ordinateFlags);
var coordSequence = factory.CoordinateSequenceFactory.Create(points.NumPoints, ordinateFlags);
for (var i = 0; i < points.NumGeometries; i++)
{
var currPoint = (IPoint) points.GetGeometryN(i);
var seq = currPoint.CoordinateSequence;
foreach (var ordinate in ordinates)
{
double d = seq.GetOrdinate(0, ordinate);
coordSequence.SetOrdinate(i, ordinate, d);
}
}
var transPoints = transform.Transform(coordSequence);
return factory.CreateMultiPoint(transPoints);
}