@has_gis<EOL><INDENT>def write_geoms_to_file(self, fp, geoms, names=None):<DEDENT>
if fp[-<NUM_LIT:5>:] != '<STR_LIT>':<EOL><INDENT>fp = fp + '<STR_LIT>'<EOL><DEDENT>if names is not None:<EOL><INDENT>assert len(geoms) == len(names), "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>names = ("<STR_LIT>".format(count) for count in itertools.count())<EOL><DEDENT>meta = {<EOL>'<STR_LIT>': {'<STR_LIT>': True, '<STR_LIT>': '<STR_LIT>', '<STR_LIT>': '<STR_LIT>', '<STR_LIT>': '<STR_LIT>'},<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': {'<STR_LIT>': '<STR_LIT>', '<STR_LIT>': {'<STR_LIT:name>': '<STR_LIT:str>', '<STR_LIT:id>': '<STR_LIT:int>'}}<EOL>}<EOL>with fiona.drivers():<EOL><INDENT>with fiona.open(fp, '<STR_LIT:w>', **meta) as sink:<EOL><INDENT>for geom, name, count in zip(geoms, names, itertools.count(<NUM_LIT:1>)):<EOL><INDENT>sink.write({<EOL>'<STR_LIT>': _to_fiona(geom),<EOL>'<STR_LIT>': {'<STR_LIT:name>': name, '<STR_LIT:id>': count}<EOL>})<EOL><DEDENT><DEDENT><DEDENT>return fp<EOL>
Write unioned geometries ``geoms`` to filepath ``fp``. Optionally use ``names`` in name field.