flexible_polyline_dart 1.0.1 copy "flexible_polyline_dart: ^1.0.1" to clipboard
flexible_polyline_dart: ^1.0.1 copied to clipboard

Package for encoding/decoding Flexible Polyline—a lossy compressed representation of coordinate pairs or triples

Flexible Polyline encoder/decoder for Dart #

The flexible polyline encoding is a lossy compressed representation of a list of coordinate pairs or coordinate triples.

Usage #

Encoding #

List<LatLngZ> pairs = List<LatLngZ>();
pairs.add(LatLngZ(50.1022829, 8.6982122));
pairs.add(LatLngZ(50.1020076, 8.6956695));
pairs.add(LatLngZ(50.1006313, 8.6914960));
pairs.add(LatLngZ(50.0987800, 8.6875156));

String encoded = FlexiblePolyline.encode(pairs /* coordinates */,
	5 /* coordinate precision */, ThirdDimension.ABSENT /* third dimension */,
	0 /* third dimension precision */);

// encoded == 'BFoz5xJ67i1B1B7PzIhaxL7Y'
copied to clipboard

Decoding #

List<LatLngZ> decoded =
    FlexiblePolyline.decode("BFoz5xJ67i1B1B7PzIhaxL7Y");

/*
decoded == [
	LatLngZ(50.10228, 8.69821),
	LatLngZ(50.10201, 8.69567),
	LatLngZ(50.10063, 8.69150),
	LatLngZ(50.09878, 8.68752),
]
*/
copied to clipboard
1
likes
150
points
141
downloads

Publisher

unverified uploader

Weekly Downloads

2024.07.08 - 2025.01.20

Package for encoding/decoding Flexible Polyline—a lossy compressed representation of coordinate pairs or triples

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, tuple

More

Packages that depend on flexible_polyline_dart