# `QuackDB.Geometry`
[🔗](https://github.com/elixir-vibe/quackdb/blob/main/lib/quack_db/geometry.ex#L1)

Helpers for DuckDB spatial `GEOMETRY` values.

DuckDB `GEOMETRY` values decode from Quack as WKB-compatible binaries. When
the optional `:geo` package is installed, this module can convert those
binaries to and from `Geo` structs.

# `decode_wkb`

```elixir
@spec decode_wkb(binary()) :: {:ok, struct()} | {:error, term()}
```

Decodes WKB-compatible geometry bytes into a `Geo` struct.

# `decode_wkb!`

```elixir
@spec decode_wkb!(binary()) :: struct()
```

Decodes WKB-compatible geometry bytes into a `Geo` struct or raises.

# `encode_wkb!`

```elixir
@spec encode_wkb!(struct()) :: binary()
```

Encodes a `Geo` struct into WKB bytes accepted by DuckDB spatial functions.

# `from_geo!`

```elixir
@spec from_geo!(struct()) :: binary()
```

Alias for `encode_wkb!/1`.

# `to_geo`

```elixir
@spec to_geo(binary()) :: {:ok, struct()} | {:error, term()}
```

Alias for `decode_wkb/1`.

# `to_geo!`

```elixir
@spec to_geo!(binary()) :: struct()
```

Alias for `decode_wkb!/1`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
