QuackDB.Geometry (quackdb v0.5.3)

Copy Markdown View Source

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.

Summary

Functions

Decodes WKB-compatible geometry bytes into a Geo struct.

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

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

Functions

decode_wkb(wkb)

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

Decodes WKB-compatible geometry bytes into a Geo struct.

decode_wkb!(wkb)

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

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

encode_wkb!(geometry)

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

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

from_geo!(geometry)

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

Alias for encode_wkb!/1.

to_geo(wkb)

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

Alias for decode_wkb/1.

to_geo!(wkb)

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

Alias for decode_wkb!/1.