> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# ST_GeomFromWKB

> Constructs a native GEOMETRY value from WKB with an explicit CRS.

Constructs a native planar `GEOMETRY` value from two-dimensional OGC Well-Known Binary (WKB).

## Syntax

```sql theme={null}
GEOMETRY ST_GeomFromWKB(VARBINARY wkb, VARCHAR crs)
```

`crs` must be a non-empty string literal. There is no default CRS and no implicit coordinate conversion or reprojection. Both WKB byte orders, all seven 2D OGC geometry families, `EMPTY`, and empty children are supported. EWKB and Z/M ordinates are not supported. Invalid WKB returns `NULL`; a `NULL` WKB returns `NULL`.

## Example

```SQL theme={null}
SELECT ST_AsText(ST_GeomFromWKB(
    ST_AsBinary(ST_GeomFromText('POINT (1 2)', 'EPSG:3857')),
    'EPSG:3857'));
```

```text theme={null}
POINT (1 2)
```

## Keywords

ST\_GEOMFROMWKB, GEOMETRY, WKB, CRS

## Related data types

[GEOMETRY](/documents/4.2/sql-reference/data-types/spatial-types/GEOMETRY.md), [VARCHAR](/documents/4.2/sql-reference/data-types/string-type/VARCHAR.md), [VARBINARY](/documents/4.2/sql-reference/data-types/string-type/BINARY.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.