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


C# ICoordinateSequence.ToCoordinateArray方法代码示例

本文整理汇总了C#中ICoordinateSequence.ToCoordinateArray方法的典型用法代码示例。如果您正苦于以下问题:C# ICoordinateSequence.ToCoordinateArray方法的具体用法?C# ICoordinateSequence.ToCoordinateArray怎么用?C# ICoordinateSequence.ToCoordinateArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICoordinateSequence的用法示例。


在下文中一共展示了ICoordinateSequence.ToCoordinateArray方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsCCW

 /// <summary>
 /// Computes whether a ring defined by a coordinate sequence is oriented counter-clockwise.
 /// </summary>>
 /// <remarks>
 /// <list type="Bullet">
 /// <item>The list of points is assumed to have the first and last points equal.</item>
 /// <item>This will handle coordinate lists which contain repeated points.</item>
 /// </list>
 /// <para>This algorithm is only guaranteed to work with valid rings. If the ring is invalid (e.g. self-crosses or touches), the computed result may not be correct.</para>
 /// </remarks>
 /// <param name="ring">A coordinate sequence froming a ring</param>
 /// <returns>true if the ring is oriented <see cref="Orientation.CounterClockwise"/></returns>
 /// <exception cref="ArgumentException">If there are too few points to determine orientation (&lt;4)</exception>
 public static bool IsCCW(ICoordinateSequence ring)
 {
     return IsCCW(ring.ToCoordinateArray());
 }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:17,代码来源:CGAlgorithms.cs

示例2: TransformCoordinates

            /// <summary>
            /// 
            /// </summary>
            /// <param name="coords"></param>
            /// <param name="parent"></param>
            /// <returns></returns>
            protected override ICoordinateSequence TransformCoordinates(ICoordinateSequence coords, IGeometry parent)
            {
                Coordinate[] inputPts = coords.ToCoordinateArray();
                Coordinate[] newPts = inputPts.Length == 0
                    ? new Coordinate[0]
                    : DouglasPeuckerLineSimplifier.Simplify(inputPts, _container.DistanceTolerance);

                return Factory.CoordinateSequenceFactory.Create(newPts);
            }
开发者ID:ste10k41,项目名称:nettopologysuite,代码行数:15,代码来源:DouglasPeuckerSimplifier.cs

示例3: Create

 /// <summary>
 /// Returns a CoordinateSequence based on the given coordinate sequence; whether or not the
 /// array is copied is implementation-dependent.
 /// </summary>
 /// <param name="coordSeq"></param>
 /// <returns></returns>
 public ICoordinateSequence Create(ICoordinateSequence coordSeq)
 {
     if (type == PackedType.Double)
          return new PackedDoubleCoordinateSequence(coordSeq.ToCoordinateArray(), dimension);
     else return new PackedFloatCoordinateSequence(coordSeq.ToCoordinateArray(), dimension);
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:12,代码来源:PackedCoordinateSequenceFactory.cs

示例4: Add

 private ICoordinateSequence Add(ICoordinateSequence seq1, ICoordinateSequence seq2)
 {
     if (seq1 == null)
     {
         return seq2;
     }
     if (seq2 == null)
     {
         return seq1;
     }
     Coordinate[] c1 = seq1.ToCoordinateArray();
     Coordinate[] c2 = seq2.ToCoordinateArray();
     Coordinate[] c3 = new Coordinate[c1.Length + c2.Length];
     Array.Copy(c1, 0, c3, 0, c1.Length);
     Array.Copy(c2, 0, c3, c1.Length, c2.Length);
     return factory.CoordinateSequenceFactory.Create(c3);
 }
开发者ID:rungwiroon,项目名称:NHibernate.Spatial,代码行数:17,代码来源:OracleGeometryReader.cs

示例5: TransformCoordinates

 protected override ICoordinateSequence TransformCoordinates(ICoordinateSequence coords, IGeometry parent)
 {
     Coordinate[] inputPts = coords.ToCoordinateArray();
     Coordinate[] newPts;
     if (inputPts.Length == 0)
         newPts = new Coordinate[0];
     else newPts = VWLineSimplifier.Simplify(inputPts, _distanceTolerance);
     return Factory.CoordinateSequenceFactory.Create(newPts);
 }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:9,代码来源:VWSimplifier.cs

示例6: TransformCoordinates

 /// <summary>
 /// 
 /// </summary>
 /// <param name="coords"></param>
 /// <param name="parent"></param>
 /// <returns></returns>
 protected override ICoordinateSequence TransformCoordinates(ICoordinateSequence coords, IGeometry parent)
 {
     ICoordinate[] srcPts = coords.ToCoordinateArray();
     ICoordinate[] newPts = SnapLine(srcPts, snapPts);
     return factory.CoordinateSequenceFactory.Create(newPts);
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:12,代码来源:GeometrySnapper.cs

示例7: reverse

    ///** Convience method for STRUCT construction. */
    //private STRUCT toSTRUCT( Datum attributes[], String dataType )
    //        throws SQLException
    //{
    //    if( dataType.startsWith("*.")){
    //        dataType = "DRA."+dataType.substring(2);//TODO here
    //    }
    //    StructDescriptor descriptor =
    //        StructDescriptor.createDescriptor( dataType, connection );
    
    //     return new STRUCT( descriptor, connection, attributes );
    //}
    
    ///** 
    // * Convience method for ARRAY construction.
    // * <p>
    // * Compare and contrast with toORDINATE - which treats <code>Double.NaN</code>
    // * as<code>NULL</code></p>
    // */
    //private ARRAY toARRAY( double doubles[], String dataType )
    //        throws SQLException
    //{
    //    ArrayDescriptor descriptor =
    //        ArrayDescriptor.createDescriptor( dataType, connection );
        
    //     return new ARRAY( descriptor, connection, doubles );
    //}
    
    ///** 
    // * Convience method for ARRAY construction.
    // */
    //private ARRAY toARRAY( int ints[], String dataType )
    //    throws SQLException
    //{
    //    ArrayDescriptor descriptor =
    //        ArrayDescriptor.createDescriptor( dataType, connection );
            
    //     return new ARRAY( descriptor, connection, ints );
    //}

    ///** 
    // * Convience method for NUMBER construction.
    // * <p>
    // * Double.NaN is represented as <code>NULL</code> to agree
    // * with JTS use.</p>
    // */
    //private NUMBER toNUMBER( double number ) throws SQLException{
    //    if( Double.isNaN( number )){
    //        return null;
    //    }
    //    return new NUMBER( number );
    //}

    /**
     * reverses the coordinate order
     *
     * @param factory
     * @param sequence
     *
     * @return CoordinateSequence reversed sequence
     */
    private ICoordinateSequence reverse(ICoordinateSequenceFactory factory, ICoordinateSequence sequence) 
    {
    	var list = new CoordinateList(sequence.ToCoordinateArray());
        list.Reverse();
        return factory.Create(list.ToCoordinateArray());
    }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:67,代码来源:OracleGeometryWriter.cs

示例8: TransformCoordinates

 protected override ICoordinateSequence TransformCoordinates(
     ICoordinateSequence coords, IGeometry parent)
 {
     var inputPts = coords.ToCoordinateArray();
     var newPts = Densifier
         .DensifyPoints(inputPts, _distanceTolerance, parent.PrecisionModel);
     // prevent creation of invalid linestrings
     if (parent is ILineString && newPts.Length == 1)
     {
         newPts = new Coordinate[0];
     }
     return Factory.CoordinateSequenceFactory.Create(newPts);
 }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:13,代码来源:Densifier.cs

示例9: PerformTest

        private static void PerformTest(ICoordinateSequence sequence)
        {
            if (sequence == null)
                throw new ArgumentNullException("sequence");

            Coordinate[] coordinates = sequence.ToCoordinateArray();
            NodedSegmentString segmentString = new NodedSegmentString(coordinates, null);
            Stopwatch watch = new Stopwatch();
            NodingValidator validator = new NodingValidator(new[] { segmentString });
            validator.CheckValid();
            watch.Start();
            validator.CheckValid();
            watch.Stop();
            Console.WriteLine("NodingValidator.CheckValid => ElapsedMilliseconds: {0}", watch.ElapsedMilliseconds);

            BasicSegmentString segmentStringBasic = new BasicSegmentString(coordinates, null);
            FastNodingValidator fastValidator = new FastNodingValidator(new[] { segmentStringBasic });
            watch.Reset(); watch.Start();
            fastValidator.CheckValid();
            watch.Stop();
            Console.WriteLine("FastNodingValidator.CheckValid => ElapsedMilliseconds: {0}", watch.ElapsedMilliseconds);
        }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:22,代码来源:SlowIntersectionTest.cs


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