Function polyline_ffi::decode_polyline_ffi [−][src]
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