Skip to main content

st_point

Function st_point 

Source
pub fn st_point(x: f64, y: f64, srid: Option<i32>) -> Result<Vec<u8>>
Expand description

ST_Point / ST_MakePoint (2D): construct a Point geometry.

ยงExample

use sqlitegis::core::functions::constructors::st_point;
use sqlitegis::core::functions::accessors::{st_x, st_y, st_srid};

let blob = st_point(1.5, 2.5, Some(4326)).unwrap();
assert!((st_x(&blob).unwrap().unwrap() - 1.5).abs() < 1e-10);
assert!((st_y(&blob).unwrap().unwrap() - 2.5).abs() < 1e-10);
assert_eq!(st_srid(&blob).unwrap(), 4326);