/// <summary> /// Writes MultiPolygon to the output using specified writer. /// </summary> /// <param name="multiPolygon">The MultiPolygon to write.</param> /// <param name="writer">The BinaryWriter used to write geometry to the output.</param> private static void WriteMultiPolygon(IMultiPolygon multiPolygon, BinaryWriter writer) { writer.Write((uint)WkbWriter.AdjustGeometryType(multiPolygon, WkbGeometryType.MultiPolygon)); writer.Write((uint)multiPolygon.Geometries.Count()); foreach (var polygon in multiPolygon.Geometries) { WkbWriter.WritePolygonContent(polygon, writer); } }
/// <summary> /// Writes GeometryCollection to the output using specified writer. /// </summary> /// <param name="collection">The GeometryCollection to write.</param> /// <param name="writer">The BinaryWriter used to write geometry to the output.</param> private static void WriteGeometryCollection(IGeometryCollection <IGeometry> collection, BinaryWriter writer) { writer.Write((uint)WkbWriter.AdjustGeometryType(collection, WkbGeometryType.GeometryCollection)); writer.Write((uint)collection.Geometries.Count()); foreach (var geometry in collection.Geometries) { WkbWriter.Write(geometry, writer); } }
/// <summary> /// Writes MultiLineString to the output using specified writer. /// </summary> /// <param name="multiLineString">The MultiLineString to write.</param> /// <param name="writer">The BinaryWriter used to write geometry to the output.</param> private static void WriteMultiLineString(IMultiLineString multiLineString, BinaryWriter writer) { writer.Write((uint)WkbWriter.AdjustGeometryType(multiLineString, WkbGeometryType.MultiLineString)); writer.Write((uint)multiLineString.Geometries.Count()); foreach (var linestring in multiLineString.Geometries) { WkbWriter.WriteCoordinates(linestring.Coordinates, writer); } }
/// <summary> /// Writes MultiPoint to the output using specified writer. /// </summary> /// <param name="multipoint">The MultiPoint to write.</param> /// <param name="writer">The BinaryWriter used to write geometry to the output.</param> private static void WriteMultiPoint(IMultiPoint multipoint, BinaryWriter writer) { writer.Write((uint)WkbWriter.AdjustGeometryType(multipoint, WkbGeometryType.MultiPoint)); writer.Write((uint)multipoint.Geometries.Count()); foreach (var point in multipoint.Geometries) { WkbWriter.WriteCoordinate(point.Position, writer); } }
/// <summary> /// Writes Point to the output using specified writer. /// </summary> /// <param name="point">The Point to write.</param> /// <param name="writer">The BinaryWriter used to write geometry to the output.</param> private static void WritePoint(IPoint point, BinaryWriter writer) { if (point.Position.Equals(Coordinate.Empty)) { writer.Write((uint)WkbGeometryType.GeometryCollection); writer.Write(0u); } else { writer.Write((uint)WkbWriter.AdjustGeometryType(point, WkbGeometryType.Point)); WkbWriter.WriteCoordinate(point.Position, writer); } }
/// <summary> /// Writes Polygon to the output using specified writer. /// </summary> /// <param name="polygon">The Polygon to write.</param> /// <param name="writer">The BinaryWriter used to write geometry to the output.</param> private static void WritePolygon(IPolygon polygon, BinaryWriter writer) { writer.Write((uint)WkbWriter.AdjustGeometryType(polygon, WkbGeometryType.Polygon)); WkbWriter.WritePolygonContent(polygon, writer); }
/// <summary> /// Writes LineString to the output using specified writer. /// </summary> /// <param name="linestring">The LineString to write.</param> /// <param name="writer">The BinaryWriter used to write geometry to the output.</param> private static void WriteLineString(ILineString linestring, BinaryWriter writer) { writer.Write((uint)WkbWriter.AdjustGeometryType(linestring, WkbGeometryType.LineString)); WkbWriter.WriteCoordinates(linestring.Coordinates, writer); }