decode_polyline_ffi

Function decode_polyline_ffi 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn decode_polyline_ffi( pl: *const c_char, precision: u32, ) -> InternalArray
Expand description

Convert a Polyline into an array of coordinates

Callers must pass two arguments:

  • a pointer to NUL-terminated characters (char*)
  • an unsigned 32-bit int for precision (5 for Google Polylines, 6 for OSRM and Valhalla Polylines)

A decoding failure will return an Array whose data field is [[NaN, NaN]], and whose len field is 1.

Implementations calling this function must call drop_float_array with the returned Array, in order to free the memory it allocates.

ยงSafety

This function is unsafe because it accesses a raw pointer which could contain arbitrary data