Split a geojson in two separate files.

    Args:
        input_file (str): Input filename.
        file_1 (str): Output file name 1.
        file_2 (str): Output file name 2.
        no_features (int): Number of features in input_file to go to file_1.
        output_file (str): Output file name.

def split(input_file, file_1, file_2, no_in_first_file):
    '''
    Split a geojson in two separate files.

    Args:
        input_file (str): Input filename.
        file_1 (str): Output file name 1.
        file_2 (str): Output file name 2.
        no_features (int): Number of features in input_file to go to file_1.
        output_file (str): Output file name.
    '''

    # get feature collection
    with open(input_file) as f:
        feat_collection = geojson.load(f)

    features = feat_collection['features']
    feat_collection_1 = geojson.FeatureCollection(features[0:no_in_first_file])
    feat_collection_2 = geojson.FeatureCollection(features[no_in_first_file:])

    with open(file_1, 'w') as f:
        geojson.dump(feat_collection_1, f)

    with open(file_2, 'w') as f:
        geojson.dump(feat_collection_2, f)