def call_3dfier(db, tile, schema_tiles,
                pc_file_name, pc_tile_case, pc_dir,
                table_index_pc, fields_index_pc,
                table_index_footprint, fields_index_footprint, uniqueid,
                extent_ewkb, clip_prefix, prefix_tile_footprint,
                yml_dir, tile_out, output_format, output_dir,
                path_3dfier, thread):
    """Call 3dfier with the YAML config created by yamlr().

    Note
    ----
    For the rest of the parameters see batch3dfier_config.yml.

    Parameters
    ----------
    db : db Class instance
    tile : str
        Name of of the 2D tile.
    schema_tiles : str
        Schema of the footprint tiles.
    pc_file_name : str
        Naming convention for the pointcloud files. See 'dataset_name' in batch3dfier_config.yml.
    pc_tile_case : str
        How the string matching is done for pc_file_name. See 'tile_case' in batch3dfier_config.yml.
    pc_dir : str
        Directory of the pointcloud files. See 'dataset_dir' in batch3dfier_config.yml.
    thread : str
        Name/ID of the active thread.
    extent_ewkb : str
        EWKB representation of 'extent' in batch3dfier_config.yml.
    clip_prefix : str
        Prefix for naming the clipped/united views. This value shouldn't be a substring of the pointcloud file names.
    prefix_tile_footprint : str or None
        Prefix prepended to the footprint tile view names. If None, the views are named as
        the values in fields_index_fooptrint['unit_name'].

    Returns
    -------
    list
        The tiles that are skipped because no corresponding pointcloud file
        was found in 'dataset_dir' (YAML)

    """
    pc_tiles = find_pc_tiles(db, table_index_pc, fields_index_pc,
                             table_index_footprint, fields_index_footprint,
                             extent_ewkb, tile_footprint=tile,
                             prefix_tile_footprint=prefix_tile_footprint)

    pc_path = find_pc_files(pc_tiles, pc_dir, pc_file_name, pc_tile_case)

    # prepare output file name
    if not tile_out:
        tile_out = tile.replace(clip_prefix, '', 1)

    # Call 3dfier ------------------------------------------------------------

    if pc_path:
        # Needs a YAML per thread so one doesn't overwrite it while the other
        # uses it
        yml_name = thread + "_config.yml"
        yml_path = os.path.join(yml_dir, yml_name)
        config = yamlr(dbname=db.dbname, host=db.host, user=db.user,
                       pw=db.password, schema_tiles=schema_tiles,
                       bag_tile=tile, pc_path=pc_path,
                       output_format=output_format, uniqueid=uniqueid)
        # Write temporary config file
        try:
            with open(yml_path, "w") as text_file:
                text_file.write(config)
        except BaseException:
            print("Error: cannot write _config.yml")
        # Prep output file name
        if "obj" in output_format.lower():
            o = tile_out + ".obj"
            output_path = os.path.join(output_dir, o)
        elif "csv" in output_format.lower():
            o = tile_out + ".csv"
            output_path = os.path.join(output_dir, o)
        else:
            output_path = os.path.join(output_dir, tile_out)
        # Run 3dfier
        command = (path_3dfier + " {yml} -o {out}").format(
            yml=yml_path, out=output_path)
        try:
            call(command, shell=True)
        except BaseException:
            print("\nCannot run 3dfier on tile " + tile)
            tile_skipped = tile
    else:
        print(
            "\nPointcloud file(s) " +
            str(pc_tiles) +
            " not available. Skipping tile.\n")
        tile_skipped = tile
        return({'tile_skipped': tile_skipped,
                'out_path': None})

    return({'tile_skipped': None,
            'out_path': output_path})