africaGambia50m top-level property

GeoJsonFeatureCollection get africaGambia50m

Parses the GeoJSON for africa/gambia.50m.json

The data is stored as gzipped binary to reduce package size. First access decompresses and parses; subsequent accesses use cached result.

Implementation

GeoJsonFeatureCollection get africaGambia50m {
  if (_cached != null) return _cached!;

  // Decode base64 and decompress
  final compressed = base64Decode(_kCompressedData);
  final decompressed = gzip.decode(compressed);
  final jsonString = utf8.decode(decompressed);

  // Parse GeoJSON
  final data = parseGeoJson(
    jsonDecode(jsonString) as Map<String, dynamic>,
  );

  if (data is! GeoJsonFeatureCollection) {
    throw StateError('Invalid GeoJSON format');
  }

  _cached = data;
  return _cached!;
}