I just upgraded to GDAL 2.2.0 and now I'm having issues with my python kernel crashing when I run gdal.Open() on certain files that it used to work on when I had GDAL 2.1.2. It seems to only be crashing on images I have created with gdal_translate or gdalwarp, but not all of them. This is the error I keep receiving in my terminal window after a crash:
x = gdal.Open("tiffpath.tif")
TIFFReadDirectory: Warning, Unknown field with tag 42113 (0xa481) encountered.
These are the commands I'm using to create the GTiffs that crash my kernel:
subprocess.call(["gdalwarp", "-of", "GTiff", "-r", "bilinear", "-srcnodata", "0", "infile1path", "infile1path", "tiffoutpath"])
gdalTranslate = r'/usr/local/Cellar/gdal2/2.2.0/bin/gdal_translate'
subset = (520926.0, 7339961.0, 686430.0, 7223749.0,"path_in","path_out")
trans = gdalTranslate + ' -of GTiff -projwin %s %s %s %s %s %s' %(subset)
os.system(trans)
I can open these images using PIL Image.open(). However, I still need gdal.Open to work so I can retrieve projection information.
I found that tag 42113 is associated with this: 'a special pixel value to mark geospatial areas for which no info is available'. Is there a glitch in the way the new gdal_translate and gdalwarp are creating geotiffs, an error in the way gdal.Open() functions with some .tif images, or something else I might be doing wrong?