Handy Orchard

Encoded polyline converter

Encode and decode Mapbox/Google-style polylines with explicit precision and GeoJSON longitude,latitude output.

Your input

Decode uses only the encoded text; encode uses only GeoJSON. GeoJSON order is longitude,latitude, unlike the library’s raw latitude,longitude array API.

Outputs are cleared when the input changes.

Result

Enter your data or use the example, then run the tool.

Worked example

The standard _p~iF… sample decodes at precision 5 to three positions: [-120.2,38.5], [-120.95,40.7], [-126.453,43.252]. Encoding that LineString recreates the same string.

Method

Use the exact Mapbox polyline toGeoJSON/fromGeoJSON algorithms with precision 5 or 6. Validate encoded character groups before decoding and validate finite GeoJSON coordinate ranges afterward. Report canonical round-trip equality and output a coordinate table plus text/GeoJSON downloads.

Limits

At least two points, at most 20000 positions; encoded text up to 200000 characters or GeoJSON up to 2097152 characters. Precision rounds coordinates; altitude is not preserved by the polyline codec. No route finding, map service, elevation lookup or XML parsing.

Processing stays local in a fixed-source, lazily loaded worker. Cancel and the four-second worker timeout terminate processing.

Sources

Pinned upstream READMEExact upstream licenseThird-party notices

Related tools

GPS coordinate notation converterPlus Code encoderGPX/KML to GeoJSONGeoJSON geodesic measurement

Your inputs stay on this device. Only optional, consented page visits are measured. Input values, files, filenames and processing logs are not sent to Analytics.

When switching languages, text, settings and selected files are temporarily kept on this device. Transfers are removed after restoring; interrupted transfers are cleaned up on a later visit. Inputs and files are never uploaded.