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


C# IMultiPoint.GetGeometryN方法代码示例

本文整理汇总了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;
 }   
开发者ID:lishxi,项目名称:_SharpMap,代码行数:18,代码来源:IsSimpleOp.cs

示例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;
        }
开发者ID:jaundice,项目名称:NetTopologySuite,代码行数:19,代码来源:IsSimpleOp.cs

示例3: AppendMultiPointText

 /// <summary>
 /// Converts a <c>MultiPoint</c> to &lt;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(")");
     }
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:22,代码来源:WKTWriter.cs

示例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);
 }
开发者ID:DIVEROVIEDO,项目名称:DotSpatial,代码行数:18,代码来源:GeometryTransformer.cs

示例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;
		}
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:17,代码来源:PostGisWriter.cs

示例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);
        }
开发者ID:leoliusg,项目名称:NetTopologySuite,代码行数:29,代码来源:GeometryTransform.cs


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