Example #1
0
        /// <summary>
        /// Returns a <see cref="CoordinateSequence" /> based on the given array;
        /// whether or not the array is copied is implementation-dependent.
        /// </summary>
        /// <param name="coordinates">A coordinates array, which may not be null nor contain null elements</param>
        /// <returns>A coordinate sequence.</returns>
        public virtual CoordinateSequence Create(Coordinate[] coordinates)
        {
            var result = Create(coordinates?.Length ?? 0, CoordinateArrays.Dimension(coordinates), CoordinateArrays.Measures(coordinates));

            if (coordinates != null)
            {
                for (int i = 0; i < coordinates.Length; i++)
                {
                    for (int dim = 0; dim < result.Dimension; dim++)
                    {
                        result.SetOrdinate(i, dim, coordinates[i][dim]);
                    }
                }
            }

            return(result);
        }
Example #2
0
 /// <summary>
 /// Compares the specified <see cref="Coordinate" />s arrays.
 /// </summary>
 /// <param name="pts1"></param>
 /// <param name="pts2"></param>
 /// <returns></returns>
 public int Compare(Coordinate[] pts1, Coordinate[] pts2)
 {
     return(CoordinateArrays.Compare(pts1, pts2));
 }