Rust

Geometries: arrays to WKT, and the SRID-prefixed WKB MariaDB and MySQL return for spatial columns (or WKT) back to coordinate arrays.

Contents

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 (.