Create a file containing only features with specified property value(s) from
        input_file.

    Args
        input_file (str): File name.
        output_file (str): Output file name.
        property_name (str): Name of the feature property to filter by.
        values (list): Value(s) a feature may have for property_name if it is to be
            included in output_file.

def filter_by_property(input_file, output_file, property_name, values):
    '''
    Create a file containing only features with specified property value(s) from
        input_file.

    Args
        input_file (str): File name.
        output_file (str): Output file name.
        property_name (str): Name of the feature property to filter by.
        values (list): Value(s) a feature may have for property_name if it is to be
            included in output_file.
    '''

    filtered_feats = []
    if not output_file.endswith('.geojson'):
        output_file += '.geojson'

    # Load feature list
    with open(input_file) as f:
        feature_collection = geojson.load(f)

    # Filter feats by property_name
    for feat in feature_collection['features']:
        if feat['properties'][property_name] in values:
            filtered_feats.append(feat)

    feature_collection['features'] = filtered_feats

    # Save filtered file
    with open(output_file, 'wb') as f:
        geojson.dump(f)