No geoKeys generated when writing a geotiff


I'm sorry if this is question is an easy one, I'm a beginner with rasterio. I have a python script that reads in a dataset, calculates an overlay layer and then outputs the calculated layer. This part works as expected. I then need to take this output geotiff and read it in for display inside a web application. Inside my web application, I need to extract data such as the geotiff's coordinate system , resolution and origin. Currently, I have some other geotiffs that were not generated using rasterio  and I'm able to fetch the needed information by extracting the geoKeys with npm's geotiff package : However, when reading my geotifffs generated with rasterio, no geoKeys are found. Below you can find my code used to open the existing dataset and the open and create options I'm using. I'm wondering if there is something that I'm missing to be able to correctly generate these geoKeys. Any help will be greatly appreciated!


def layers(directory, gis_data, maptype, mapname):
    h = gis_data.height
    w = gis_data.width
    c =
    t = gis_data.transform
    output_folder = directory + 'output'
    if not os.path.exists(output_folder):
    mapname =
        output_folder + '/' + mapname + '.tiff',
        driver = 'GTiff',
        height = h,
        width = w,
        count = 1,
        dtype = np.uint8,
        crs = c,
        transform = t,
georef_sources='INTERNAL', ) mapname.write(maptype, 1) mapname.close()

Join to automatically receive all group messages.