Geo v3.0.0 Geo.WKT View Source

Converts to and from WKT and EWKT

{:ok, point} = Geo.WKT.decode("POINT(30 -90)")
Geo.Point[coordinates: {30, -90}, srid: nil]

Geo.WKT.encode!(point)
"POINT(30 -90)"

point = Geo.WKT.decode!("SRID=4326;POINT(30 -90)")
Geo.Point[coordinates: {30, -90}, srid: 4326]

Link to this section Summary

Functions

Takes a WKT string and returns a Geo.geometry struct or list of Geo.geometry

Takes a WKT string and returns a Geo.geometry struct or list of Geo.geometry

Takes a Geometry and returns a WKT string

Takes a Geometry and returns a WKT string

Link to this section Functions

Link to this function decode(wkt) View Source
decode(binary()) :: {:ok, Geo.geometry()} | {:error, Exception.t()}

Takes a WKT string and returns a Geo.geometry struct or list of Geo.geometry

Takes a WKT string and returns a Geo.geometry struct or list of Geo.geometry

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

Takes a Geometry and returns a WKT string

Takes a Geometry and returns a WKT string