Dear community and author Phil Harvey,
I'm using Linux Lubuntu 18.04 with exiftool command line in order to modify TIFF-Tags of a land cover classification GeoTIFF-file.
As the Python libraries
import exifread
import PIL
import tifffile as tf
from skimage.external import tifffile as sk_tf
don't even list the GeoTiff tags, as they are "blind on that eye", I found that exiftool lists, but cannot change them.
The output of my example file, using exiftool in the terminal, is:Input:
exiftool -D -G -a -u -U -f "newfile.tif"
Output:
[ExifTool] - ExifTool Version Number : 10.80
[File] - File Name : newfile.tif
[File] - Directory : .
[File] - File Size : 1503 kB
[File] - File Modification Date/Time : 2019:12:19 17:32:17+01:00
[File] - File Access Date/Time : 2019:12:19 17:32:17+01:00
[File] - File Inode Change Date/Time : 2019:12:19 17:32:17+01:00
[File] - File Permissions : rw-rw-r--
[File] - File Type : TIFF
[File] - File Type Extension : tif
[File] - MIME Type : image/tiff
[File] - Exif Byte Order : Little-endian (Intel, II)
[File] - Current IPTC Digest : 79ffcf282ca6974ff99640a7421b40b7
[EXIF] 256 Image Width : 1148
[EXIF] 257 Image Height : 1337
[EXIF] 258 Bits Per Sample : 8
[EXIF] 259 Compression : Uncompressed
[EXIF] 262 Photometric Interpretation : RGB Palette
[EXIF] 273 Strip Offsets : (Binary data 1390 bytes, use -b option to extract)
[EXIF] 274 Orientation : Horizontal (normal)
[EXIF] 277 Samples Per Pixel : 1
[EXIF] 278 Rows Per Strip : 7
[EXIF] 279 Strip Byte Counts : (Binary data 954 bytes, use -b option to extract)
[EXIF] 282 X Resolution : 1
[EXIF] 283 Y Resolution : 1
[EXIF] 284 Planar Configuration : Chunky
[EXIF] 296 Resolution Unit : None
[EXIF] 305 Software : IMAGINE TIFF Support.Copyright 1991 - 1999 by ERDAS, Inc. All Rights Reserved.@(#)$RCSfile: etif.c $ $Revision: 1.11 $ $Date$
[EXIF] 320 Color Map : (Binary data 1536 bytes, use -b option to extract)
[EXIF] 339 Sample Format : Unsigned
[EXIF] 33550 Pixel Scale : 30 30 0
[EXIF] 33922 Model Tie Point : 0 0 0 1514925 1583985 0
[IPTC] 25 Keywords : word
[IPTC] 0 Application Record Version : 4
[GeoTiff] 1 Geo Tiff Version : 1.1.0
[GeoTiff] 1024 GT Model Type : Projected
[GeoTiff] 1025 GT Raster Type : Pixel Is Area
[GeoTiff] 1026 GT Citation : IMAGINE GeoTIFF Support.Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved.@(#)$RCSfile: egtf.c $ $Revision: 1.11.2.3 $ $Date: 2004/11/24 09:12:56EST $.Projection Name = USA_Contiguous_Albers_Equal_Area_Conic_USGS_version.Units = meters.GeoTIFF Units = meters
[GeoTiff] 2048 Geographic Type : NAD83
[GeoTiff] 3072 Projected CS Type : User Defined
[GeoTiff] 3073 PCS Citation : IMAGINE GeoTIFF Support.Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved.@(#)$RCSfile: egtf.c $ $Revision: 1.11.2.3 $ $Date: 2004/11/24 09:12:56EST $.Projection = Albers Conical Equal Area
[GeoTiff] 3074 Projection : User Defined
[GeoTiff] 3075 Proj Coord Trans : Albers Equal Area
[GeoTiff] 3076 Proj Linear Units : Linear Meter
[GeoTiff] 3078 Proj Std Parallel 1 : 29.5
[GeoTiff] 3079 Proj Std Parallel 2 : 45.5
[GeoTiff] 3081 Proj Nat Origin Lat : 23
[GeoTiff] 3082 Proj False Easting : 0
[GeoTiff] 3083 Proj False Northing : 0
[GeoTiff] 3088 Proj Center Long : -96
[Composite] - Image Size : 1148x1337
[Composite] - Megapixels : 1.5
Now, I'd like to change/delete the GeoTiff-TAG "Projection", which throws the following warning message without changing anything:Input:
exiftool "-Projection=" "newfile.tif"
Output:
Warning: Sorry, Projection is not writable. Nothing to do.
Next, I found the following documentation of this very webpage:
https://exiftool.org/TagNames/GeoTiff.htmlIt states, among other details, the following:GeoTIFF tags are not writable individually, but they may be copied en mass via the block tags GeoTiffDirectory, GeoTiffDoubleParams and GeoTiffAsciiParams.
Is there any possibility to change/rename/delete a GeoTiff-TAG of choice via command line exiftools as stated above in my attempt?I'm quite desparate already, since I've invested a lot of time in finding a possiblity, but so far no avail.
Thanks in advance for helping me out.
Kind regards,
Andreas