IWks
This interface exposes methods for converting geometries to and from their Well-Known Text (WKT) and Well-Known Binary (WKB) representations. See “Well-Known Text Representation for Geometric Objects” in the “Overview” chapter for background information on WKT and WKB.
|
Methods |
|
|
Converts a geometry into Well-Known Binary format. |
|
|
Converts a geometry into Well-Known Text format. |
|
|
Assigns geometry from Well-Known Binary data. |
|
|
Assigns geometry from Well-Known Text data. |
ExportToWKB
Converts a geometry into Well-Known Binary format.
JavaScript |
|
ExportToWKB( b3Dimension) |
C# |
|
dynamic ExportToWKB( bool b3Dimension) |
C++ |
|
HRESULT ExportToWKB(
|
Parameters
b3Dimension
A Boolean that determines whether Z values are exported to the WKB. When set to TRUE, they are exported; when FALSE, they are omitted.
Return Value
wkb
A Safe Array of unsigned bytes.
Note: In JavaScript, use the VBArray object. E.g.,
var wkb = geometry.ExportToWKB(true);
var arr = new VBArray(wkb).toArray();
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.
ExportToWKT
Converts a geometry into Well-Known Text format. Note that the exported WKT is only 2D and any 3D information is omitted. If you want to preserve 3D information, use ExportToWKB.
JavaScript |
|
ExportToWKT() |
C# |
|
string ExportToWKT() |
C++ |
|
HRESULT ExportToWKT( BSTR* wkt) |
Return Value
wkt
The Well-Known Text representation for the geometry.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.
ImportFromWKB
Assigns geometry from Well-Known Binary data. The created geometry always includes Z values even if they weren't present in the WKB.
JavaScript |
|
ImportFromWKB( buffer) |
C# |
|
void ImportFromWKB( object buffer) |
C++ |
|
HRESULT ImportFromWKB( VARIANT buffer) |
Parameters
buffer
The buffer containing the Well-Known Binary representation for the geometry object.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.
ImportFromWKT
Assigns geometry from Well-Known Text data. The created geometry always includes Z values even if they weren't present in the WKT.
JavaScript |
|
ImportFromWKT( wkt) |
C# |
|
void ImportFromWKT( string wkt) |
C++ |
|
HRESULT ImportFromWKT( BSTR wkt) |
Parameters
wkt
The Well-Known Text representation.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.