Convert Arcpy functions to gdal