def write_vector_window(<EOL>in_data=None, out_schema=None, out_tile=None, out_path=None, bucket_resource=None<EOL>):
<EOL>try:<EOL><INDENT>os.remove(out_path)<EOL><DEDENT>except OSError:<EOL><INDENT>pass<EOL><DEDENT>out_features = []<EOL>for feature in in_data:<EOL><INDENT>try:<EOL><INDENT>for out_geom in multipart_to_singleparts(<EOL>clean_geometry_type(<EOL>to_shape(feature["<STR_LIT>"]).intersection(out_tile.bbox),<EOL>out_schema["<STR_LIT>"]<EOL>)<EOL>):<EOL><INDENT>out_features.append({<EOL>"<STR_LIT>": mapping(out_geom),<EOL>"<STR_LIT>": feature["<STR_LIT>"]<EOL>})<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>logger.warning("<STR_LIT>", e)<EOL>continue<EOL><DEDENT><DEDENT>if out_features:<EOL><INDENT>try:<EOL><INDENT>if out_path.startswith("<STR_LIT>"):<EOL><INDENT>with VectorWindowMemoryFile(<EOL>tile=out_tile,<EOL>features=out_features,<EOL>schema=out_schema,<EOL>driver="<STR_LIT>"<EOL>) as memfile:<EOL><INDENT>logger.debug((out_tile.id, "<STR_LIT>", out_path))<EOL>bucket_resource.put_object(<EOL>Key="<STR_LIT:/>".join(out_path.split("<STR_LIT:/>")[<NUM_LIT:3>:]),<EOL>Body=memfile<EOL>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>with fiona.open(<EOL>out_path, '<STR_LIT:w>', schema=out_schema, driver="<STR_LIT>",<EOL>crs=out_tile.crs.to_dict()<EOL>) as dst:<EOL><INDENT>logger.debug((out_tile.id, "<STR_LIT>", out_path))<EOL>dst.writerecords(out_features)<EOL><DEDENT><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>logger.error("<STR_LIT>", out_path, e)<EOL>raise<EOL><DEDENT><DEDENT>else:<EOL><INDENT>logger.debug((out_tile.id, "<STR_LIT>", out_path))<EOL><DEDENT>
Write features to GeoJSON file.

Parameters
----------
in_data : features
out_schema : dictionary
    output schema for fiona
out_tile : ``BufferedTile``
    tile used for output extent
out_path : string
    output path for GeoJSON file