Skip to content

Expose SRID from EWKB buffers when reading #52

@kylebarron

Description

@kylebarron

Potentially we could even make this a separate standalone function, which would allow us to avoid exposing the concrete implementations on the reader side.

We already check whether the srid exists:

wkb/src/reader/util.rs

Lines 28 to 37 in 39bca1d

pub(crate) fn has_srid(buf: &[u8], byte_order: Endianness, offset: u64) -> bool {
// Read geometry code to see if an SRID exists.
let mut reader = Cursor::new(buf);
// Skip 1-byte byte order that we already know
reader.set_position(1 + offset);
let geometry_code = WKBGeometryCode::new(reader.read_u32(byte_order).unwrap());
geometry_code.has_srid()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions