def METHOD_NAME(filename, lat, longit, altitude): #lat and long are decimals
    gps = {} #create array
    #Altitude
    if altitude<0:
        gps[piexif.GPSIFD.GPSAltitudeRef] = 1; #Below see level
    else:
        gps[piexif.GPSIFD.GPSAltitudeRef] = 0; #Above see level
        gps[piexif.GPSIFD.GPSAltitude]= (int(abs(altitude)*100),100)
    #Latitude
    if lat<0:
        gps[piexif.GPSIFD.GPSLatitudeRef] = "S"
    else:
        gps[piexif.GPSIFD.GPSLatitudeRef] = "N"
    latd,latm,lats = ExifWriter._decdeg2dms(lat)
    gps[piexif.GPSIFD.GPSLatitude] = [(latd,1),(latm,1),(lats*100,100)];
    #Longitude
    if longit<0:
        gps[piexif.GPSIFD.GPSLongitudeRef] = "W"
    else:
        gps[piexif.GPSIFD.GPSLongitudeRef] = "E"
    longd,longm,longs = ExifWriter._decdeg2dms(longit)
    gps[piexif.GPSIFD.GPSLongitude] = [(longd,1),(longm,1),(longs*100,100)];
    exifdict =  piexif.load(filename)
    exifdict["GPS"] = gps
    exif_bytes = piexif.dump(exifdict)
    piexif.insert(exif_bytes, filename)
    exifdict = piexif.load(filename)