Exemple #1
0
 /// <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);
     }
 }
Exemple #2
0
        /// <summary>
        /// Writes content of the 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 WritePolygonContent(IPolygon polygon, BinaryWriter writer)
        {
            if (polygon.ExteriorRing.Count == 0)
            {
                writer.Write(0u);
            }
            else
            {
                writer.Write((uint)(1 + polygon.InteriorRings.Count()));
                WkbWriter.WriteCoordinates(polygon.ExteriorRing, writer);

                foreach (var ring in polygon.InteriorRings)
                {
                    WkbWriter.WriteCoordinates(ring, writer);
                }
            }
        }
Exemple #3
0
 /// <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);
 }