decodePoint method
Decode LineString geometry
@docs: https://github.com/mapbox/vector-tile-spec/tree/master/2.1#4342-point-geometry-type
Implementation
List<List<int>> decodePoint() {
int length = 0;
int commandId = 0;
int x = 0;
int y = 0;
bool isX = true;
List<List<int>> coords = [];
List<int> point = [];
this.geometryList!.forEach((commandInt) {
if (length <= 0) {
Command command = Command.CommandInteger(command: commandInt);
commandId = command.id;
length = command.count;
} else if (commandId != CommandID.ClosePath) {
if (isX) {
x += Command.zigZagDecode(commandInt);
point.add(x);
isX = false;
} else {
y += Command.zigZagDecode(commandInt);
point.add(y);
length -= 1;
isX = true;
}
}
if (length <= 0) {
coords.add(point);
point = [];
}
});
return coords;
}