spatial
ModuleGeometries: arrays to WKT, and the SRID-prefixed WKB MariaDB and MySQL return for spatial columns (or WKT) back to coordinate arrays.
Contents
Functions
array_to_wkt`POINT(x y)`, `LINESTRING(...)` or `POLYGON((...), ...)`.decode_linestring(SQL): `[[x, y], ...]` from WKT, or from WKB behind a 4-byte SRID.decode_point(SQL): `[x, y]` from WKT, or from WKB behind a 4-byte SRID.decode_polygon(SQL): `[[[x, y], ...], ...]` from WKT, hex or binary WKB behind a 4-byte SRID.type_from_wktThe lowercase type before `(`.use utopia_database::adapter::mariadb::spatial::array_to_wkt;Rust
pub fn array_to_wkt(geometry: &Array) -> Result<String>POINT(x y), LINESTRING(...) or
POLYGON((...), ...).
use utopia_database::adapter::mariadb::spatial::decode_linestring;Rust
pub fn decode_linestring(wkb: &[u8]) -> Result<Value>(SQL): [[x, y], ...] from WKT, or from WKB
behind a 4-byte SRID.
use utopia_database::adapter::mariadb::spatial::decode_point;Rust
pub fn decode_point(wkb: &[u8]) -> Result<Value>(SQL): [x, y] from WKT, or from WKB behind a
4-byte SRID.
use utopia_database::adapter::mariadb::spatial::decode_polygon;Rust
pub fn decode_polygon(wkb: &[u8]) -> Result<Value>(SQL): [[[x, y], ...], ...] from WKT, hex or
binary WKB behind a 4-byte SRID.
use utopia_database::adapter::mariadb::spatial::type_from_wkt;Rust
pub fn type_from_wkt(wkt: &[u8]) -> Result<Vec<u8>>The lowercase type before (.