Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Math.PolylineEncode

Encodes number in Polyline Algorithm Format.

Component Version macOS Windows Linux Server iOS SDK
Math 9.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Math.PolylineEncode"; Value )   More

Parameters

Parameter Description Example
Value The value to encode. 40,7

Result

Returns text or error.

Description

Encodes number in Polyline Algorithm Format.
We take a number (latitude or longitude) and encode it as an ASCII text.

See
https://developers.google.com/maps/documentation/utilities/polylinealgorithm

Examples

Encode number:

MBS("Math.PolylineEncode"; 38.5)

Example result: _p~iF

Encode another value:

MBS("Math.PolylineEncode"; -120.2)

Example result: ~ps|U

Encode a polyline with 3 points:

// Points: (38.5, -120.2), (40.7, -120.95), (43.252, -126.453)
MBS("Math.PolylineEncode"; 38.5) & MBS("Math.PolylineEncode"; -120.20) &
MBS("Math.PolylineEncode"; 40.7 - 38.5) & MBS("Math.PolylineEncode"; -120.95 - -120.2) &
MBS("Math.PolylineEncode"; 43.252 - 40.7) & MBS("Math.PolylineEncode"; -126.453 - -120.95)

Example result: _p~iF~ps|U_ulLnnqC_mqNvxq`@

See also

Release notes

Blog Entries

This function is free to use.

Created 31st March 2019, last changed 30th January 2023


Math.PolylineDecode - Math.Random.ExponentialDistribution