docs: def load(filename, drop=False):
      '''
      Load a geozones archive from <filename>
  
      <filename> can be either a local path or a remote URL.
      '''
      if filename.startswith('http'):
          log.info('Downloading GeoZones bundle: %s', filename)
          filename, _ = urlretrieve(filename, tmp.path('geozones.tar.xz'))
  
      log.info('Extracting GeoZones bundle')
      with contextlib.closing(lzma.LZMAFile(filename)) as xz:
          with tarfile.open(fileobj=xz) as f:
              f.extractall(tmp.root)
  
      log.info('Loading GeoZones levels')
  
      if drop:
          log.info('Dropping existing levels')
          GeoLevel.drop_collection()
  
      log.info('Loading levels.msgpack')
      levels_filepath = tmp.path('levels.msgpack')
      with open(levels_filepath) as fp:
          unpacker = msgpack.Unpacker(fp, encoding=str('utf-8'))
          for i, level in enumerate(unpacker, start=1):
              GeoLevel.objects(id=level['id']).modify(
                  upsert=True,
                  set__name=level['label'],
                  set__parents=[level_ref(p) for p in level['parents']],
                  set__admin_level=level.get('admin_level')
              )
      os.remove(levels_filepath)
      log.info('Loaded {total} levels'.format(total=i))
  
      if drop:
          log.info('Dropping existing spatial zones')
          GeoZone.drop_collection()
  
      log.info('Loading zones.msgpack')
      zones_filepath = tmp.path('zones.msgpack')
      with open(zones_filepath) as fp:
          unpacker = msgpack.Unpacker(fp, encoding=str('utf-8'))
          unpacker.next()  # Skip headers.
          for i, geozone in enumerate(unpacker):
              params = {
                  'slug': slugify.slugify(geozone['name'], separator='-'),
                  'level': geozone['level'],
                  'code': geozone['code'],
                  'name': geozone['name'],
                  'keys': geozone.get('keys'),
                  'parents': geozone.get('parents', []),
                  'ancestors': geozone.get('ancestors', []),
                  'successors': geozone.get('successors', []),
                  'validity': geozone.get('validity'),
                  'population': geozone.get('population'),
                  'dbpedia': geozone.get('dbpedia'),
                  'flag': geozone.get('flag'),
                  'blazon': geozone.get('blazon'),
                  'wikipedia': geozone.get('wikipedia'),
                  'area': geozone.get('area'),
              }
              if geozone.get('geom') and (
                  geozone['geom']['type'] != 'GeometryCollection' or
                      geozone['geom']['geometries']):
                  params['geom'] = geozone['geom']
              try:
                  GeoZone.objects(id=geozone['_id']).modify(upsert=True, **{
                      'set__{0}'.format(k): v for k, v in params.items()
                  })
              except errors.ValidationError as e:
                  log.warning('Validation error (%s) for %s with %s',
                              e, geozone['_id'], params)
                  continue
      os.remove(zones_filepath)
      log.info('Loaded {total} zones'.format(total=i))
  
      shutil.rmtree(tmp.path('translations'))