Geo v3.0.0 Geo.WKB View Source

Converts to and from WKB and EWKB

{:ok, point} = Geo.WKB.decode("0101000000000000000000F03F000000000000F03F")
Geo.Point[coordinates: {1, 1}, srid: nil]

Geo.WKT.encode!(point)
"POINT(1 1)"

point = Geo.WKB.decode!("0101000020E61000009EFB613A637B4240CF2C0950D3735EC0")
Geo.Point[coordinates: {36.9639657, -121.8097725}, srid: 4326]

Link to this section Summary

Functions

Takes a WKB string and returns a Geometry

Takes a WKB string and returns a Geometry

Takes a Geometry and returns a WKB string. The endian decides what the byte order will be

Takes a Geometry and returns a WKB string. The endian decides what the byte order will be

Link to this section Functions

Link to this function decode(wkb, geometries \\ []) View Source
decode(binary(), [Geo.geometry()]) ::
  {:ok, Geo.geometry()} | {:error, Exception.t()}

Takes a WKB string and returns a Geometry

Link to this function decode!(wkb, geometries \\ []) View Source
decode!(binary(), [Geo.geometry()]) :: Geo.geometry() | no_return()

Takes a WKB string and returns a Geometry

Link to this function encode(geom, endian \\ :xdr) View Source
encode(binary(), Geo.endian()) :: {:ok, binary()} | {:error, Exception.t()}

Takes a Geometry and returns a WKB string. The endian decides what the byte order will be

Link to this function encode!(geom, endian \\ :xdr) View Source
encode!(binary(), Geo.endian()) :: binary() | no_return()

Takes a Geometry and returns a WKB string. The endian decides what the byte order will be