ArcGIS Pro 2.6 API Reference Guide
ImportFromWKB Method (IGeometryEngine)
Example 

ArcGIS.Core.Geometry Namespace > IGeometryEngine Interface : ImportFromWKB Method
A combination of WKBImportFlags which determines how the geometry is imported.
The well-known binary buffer. The buffer must be OGC compliant.
The spatial reference of the output geometry.
Creates a geometry based on the contents of the input well-known binary buffer.
Syntax

Parameters

importFlags
A combination of WKBImportFlags which determines how the geometry is imported.
buffer
The well-known binary buffer. The buffer must be OGC compliant.
spatialReference
The spatial reference of the output geometry.

Return Value

A Geometry that corresponds to the buffer.
Example
// create a polyline
List<Coordinate2D> coords = new List<Coordinate2D>
{
  new Coordinate2D(0, 0),
  new Coordinate2D(0, 1),
  new Coordinate2D(1, 1),
  new Coordinate2D(1, 0)
};

Polyline polyline = PolylineBuilder.CreatePolyline(coords, SpatialReferences.WGS84);

WKBExportFlags wkbExportFlags = WKBExportFlags.wkbExportDefaults;
WKBImportFlags wkbImportFlags = WKBImportFlags.wkbImportDefaults;

// export and import
byte[] buffer = GeometryEngine.Instance.ExportToWKB(wkbExportFlags, polyline);
Geometry geometry = GeometryEngine.Instance.ImportFromWKB(wkbImportFlags, buffer, SpatialReferences.WGS84);
Polyline importPolyline = geometry as Polyline;


// alternatively, determine the size for the buffer
int bufferSize = GeometryEngine.Instance.GetWKBSize(wkbExportFlags, polyline);
buffer = new byte[bufferSize];
// export
bufferSize = GeometryEngine.Instance.ExportToWKB(wkbExportFlags, polyline, ref buffer);
// import
importPolyline = GeometryEngine.Instance.ImportFromWKB(wkbImportFlags, buffer, SpatialReferences.WGS84) as Polyline;
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also

Reference

IGeometryEngine Interface
IGeometryEngine Members