C# Class Mapsui.Geometries.WellKnownBinary.GeometryToWKB

Converts a Mapsui.Geometries.Geometry instance to a Well-known Binary string representation.

The Well-known Binary Representation for Mapsui.Geometries.Geometry (WKBGeometry) provides a portable representation of a Mapsui.Geometries.Geometry value as a contiguous stream of bytes. It permits Mapsui.Geometries.Geometry values to be exchanged between an ODBC client and an SQL database in binary form.

The Well-known Binary Representation for Mapsui.Geometries.Geometry is obtained by serializing a Mapsui.Geometries.Geometry instance as a sequence of numeric types drawn from the set {Unsigned Integer, Double} and then serializing each numeric type as a sequence of bytes using one of two well defined, standard, binary representations for numeric types (NDR, XDR). The specific binary encoding (NDR or XDR) used for a geometry byte stream is described by a one byte tag that precedes the serialized bytes. The only difference between the two encodings of geometry is one of byte order, the XDR encoding is Big Endian, the NDR encoding is Little Endian.

Datei anzeigen Open project: pauldendulk/Mapsui

Public Methods

Method Description
Write ( Geometry g, WkbByteOrder wkbByteOrder = WkbByteOrder.Ndr ) : byte[]

Writes a geometry to a byte array using the specified encoding.

Private Methods

Method Description
WriteDouble ( double value, BinaryWriter writer, WkbByteOrder byteOrder ) : void

Writes a double to the binarywriter using the specified encoding

WriteGeometry ( Geometry geometry, BinaryWriter bWriter, WkbByteOrder byteorder ) : void

Writes the geometry to the binary writer.

WriteGeometryCollection ( GeometryCollection gc, BinaryWriter bWriter, WkbByteOrder byteorder ) : void

Writes a geometrycollection.

WriteLineString ( LineString ls, BinaryWriter bWriter, WkbByteOrder byteorder ) : void

Writes a linestring.

WriteMultiLineString ( MultiLineString mls, BinaryWriter bWriter, WkbByteOrder byteorder ) : void

Writes a multilinestring.

WriteMultiPoint ( MultiPoint mp, BinaryWriter bWriter, WkbByteOrder byteorder ) : void

Writes a multipoint.

WriteMultiPolygon ( MultiPolygon mp, BinaryWriter bWriter, WkbByteOrder byteorder ) : void

Writes a multipolygon.

WritePoint ( System.Point point, BinaryWriter bWriter, WkbByteOrder byteorder ) : void

Writes a point.

WritePolygon ( Polygon poly, BinaryWriter bWriter, WkbByteOrder byteorder ) : void

Writes a polygon.

WriteType ( Geometry geometry, BinaryWriter bWriter, WkbByteOrder byteorder ) : void

Writes the type number for this geometry.

WriteUInt32 ( uint value, BinaryWriter writer, WkbByteOrder byteOrder ) : void

Writes an unsigned integer to the binarywriter using the specified encoding

Method Details

Write() public static method

Writes a geometry to a byte array using the specified encoding.
public static Write ( Geometry g, WkbByteOrder wkbByteOrder = WkbByteOrder.Ndr ) : byte[]
g Geometry The geometry to write
wkbByteOrder WkbByteOrder Byte order
return byte[]