GeoFrame.Postgrex.Extension (GeoFrame v0.3.4)

Copy Markdown View Source

A Postgrex.Extension for the PostGIS geometry type.

Postgrex has no built-in handler for geometry; this one decodes a value to its raw EWKB binary (WKB plus the SRID) without building Elixir structs, which is exactly what GeoFrame.read_postgis/3 consumes. It uses the text transfer format (hex EWKB) because the binary geometry_send drops the SRID. On encode it accepts an EWKB or WKB binary.

Register it through GeoFrame.Postgrex.Types, or define your own types module:

Postgrex.Types.define(MyApp.PostgresTypes, [GeoFrame.Postgrex.Extension])