/// <summary> /// Tests if MultiPoint is simple. /// </summary> /// <param name="mp">Geometry to test. Must be of type MultiPoint.</param> /// <returns>Returns True if geometry is simple.</returns> /// <remarks>A MultiPoint is simple if and only if it has no repeated points.</remarks> public bool IsSimple( MultiPoint mp ) { if ( mp.IsEmpty() ) { return true; } SortedList points = new SortedList(); for ( int i = 0; i < mp.GetNumGeometries(); i++ ) { Point pt = (Point) mp.GetGeometryN( i ); Coordinate p = pt.GetCoordinate(); if ( points.Contains( p ) ) { return false; } points.Add( p, p ); } //for ( int i = 0; i < mp.NumGeometries; i++ ) return true; } // public bool IsSimple( MultiPoint mp )
/// <summary> /// Converts a MultiPoint to <MultiPoint Text> format, then /// Appends it to the writer. /// </summary> /// <param name="multiPoint">The MultiPoint to process.</param> /// <param name="writer">The output stream writer to Append to.</param> protected void AppendMultiPointText(MultiPoint multiPoint, TextWriter writer) { if (multiPoint.IsEmpty()) { //writer.Write("EMPTY"); } else { for (int i = 0; i < multiPoint.GetNumGeometries(); i++) { AppendPointTaggedText( multiPoint.GetCoordinate(i), writer, _precisionModel); } } }
/// <summary> /// Converts a MultiPoint to <MultiPoint Text> format, then /// Appends it to the writer. /// </summary> /// <param name="multiPoint">The MultiPoint to process.</param> /// <param name="level"></param> /// <param name="writer">The output stream writer to Append to.</param> protected void AppendMultiPointText(MultiPoint multiPoint, int level, StringWriter writer) { if ( multiPoint.IsEmpty() ) { writer.Write("EMPTY"); } else { writer.Write("("); for (int i = 0; i < multiPoint.GetNumGeometries(); i++) { if (i > 0) { writer.Write(", "); } AppendCoordinate( multiPoint.GetCoordinates()[i], writer, multiPoint.PrecisionModel ); } writer.Write(")"); } }