---
title: fromWKB (Geometry)
description: "Geometry.fromWKB class in PySpark: Constructs a Geometry object from WKB."
canonical_url: https://docs.databricks.com/gcp/en/pyspark/reference/classes/geometry/fromWKB
---

# fromWKB (Geometry)

Constructs a `Geometry` object from WKB.

## Syntax

```
Geometry.fromWKB(wkb: bytes, srid: int)
```

## Parameters

| Parameter | Type  | Description                                              |
| --------- | ----- | -------------------------------------------------------- |
| `wkb`     | bytes | The bytes representing the WKB of the Geometry.          |
| `srid`    | int   | The integer value representing the SRID of the Geometry. |

## Returns

`Geometry`

## Examples

```python
from pyspark.sql.types import Geometry
wkb = bytes.fromhex('010100000000000000000031400000000000001c40')
g = Geometry.fromWKB(wkb, 0)
```
