decode method
Decodes a given String into a List
Implementation
List<double> decode(String geohash) {
if (geohash.isEmpty) {
throw ArgumentError.value(geohash, "geohash");
} else if (!geohash
.contains(new RegExp(r'^[0123456789bcdefghjkmnpqrstuvwxyz]+$'))) {
throw ArgumentError("Invalid character in GeoHash");
}
List<int> bits = _geoHashToBits(geohash);
List<int> longitudeBits = [];
List<int> latitudeBits = [];
for (int i = 0; i < bits.length; i++) {
if (i % 2 == 0 || i == 0) {
longitudeBits.add(bits[i]);
} else {
latitudeBits.add(bits[i]);
}
}
return [
_bitsToDouble(bits: longitudeBits, lower: -180, upper: 180),
_bitsToDouble(bits: latitudeBits)
];
}