Skip to main content

parse_ewkb_header

Function parse_ewkb_header 

Source
pub fn parse_ewkb_header(blob: &[u8]) -> Result<EwkbHeader>
Expand description

Peek at the EWKB header without fully parsing the geometry.

ยงExample

use sqlitegis::core::ewkb::parse_ewkb_header;
use sqlitegis::core::functions::io::geom_from_text;

let blob = geom_from_text("POINT(1 2)", Some(4326)).unwrap();
let hdr = parse_ewkb_header(&blob).unwrap();
assert_eq!(hdr.geom_type, 1); // WKB_POINT
assert_eq!(hdr.srid, Some(4326));