/// <summary> /// Converts the List of Coordinates to WKT format and appends it to output stream. /// </summary> /// <param name="coordinates">The list of coordinates to be converted.</param> /// <param name="writer">The output stream.</param> /// <param name="wrap">bool value indicating whether the list of coordinates should be enclosed in parathenes.</param> private static void AppendCoordinates(ICoordinateList coordinates, TextWriter writer, bool wrap) { if (coordinates.Count == 0) { return; } if (wrap) { writer.Write("("); } WktWriter.AppendCoordinate(coordinates[0], writer); for (int i = 1; i < coordinates.Count; i++) { writer.Write(", "); WktWriter.AppendCoordinate(coordinates[i], writer); } if (wrap) { writer.Write(")"); } }
/// <summary> /// Converts Point's content to WKT format and appends it to the output stream. /// </summary> /// <param name="point">The Point to be converted.</param> /// <param name="writer">The output Stream to append WKT representation to.</param> private static void AppendPointText(IPoint point, TextWriter writer) { if (point.Position.Equals(Coordinate.Empty)) { writer.Write("empty"); } else { writer.Write("("); WktWriter.AppendCoordinate(point.Position, writer); writer.Write(")"); } }