Tuesday, May 13, 2008

What is wrong with my GeoTIFF?

Maybe, it is not really a GeoTIFF?

Many people have tried over the last decade to standardize on GeoTIFF as a neutral data delivery format. This was the intent and design of the format. So, why are many still having problems with GeoTIFF?

GeoTIFF is built upon Adobe’s TIFF Revision 6 Specifications (see: http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf). While this data format is well documented, it is not followed by some software when creating and modifying data. This creates a challenge because some very prominent software companies are among the offenders. We are not immune to this non-standard software tweaking in the remote sensing, photogrammetry and GIS (geospatial) communities. Typically, today’s geospatial data providers have painstakingly located software that conforms to the GeoTIFF specifications (see: http://www.remotesensing.org/geotiff/geotiff.html) in a very strict manner. So, when we take receipt of data from today’s data vendors, we can be confident we have a proper GeoTIFF.

Again, some very prominent software does not conform to the TIFF and GeoTIFF specifications. When GeoTIFF data are modified subsequent to delivery to GIS, remote sensing and photogrammetry practitioners; often the practitioner will use software that does not conform to TIFF/GeoTIFF specifications to modify the data. This is where problems occur. When software creates a TIFF with non-standard GeoTIFF tags, it ceases to be a GeoTIFF, and is simply a TIFF with geographic information associated. These associated files are seldom readable by packages outside of the creating package, thus decreasing the portability of the image data. When you must modify GeoTIFF data, be sure you can create a true GeoTIFF.

While ERDAS IMAGINE is flexible and forgiving when reading many non-standard TIFF data with geographic information associated, ERDAS IMAGINE follows GeoTIFF specifications very carefully when creating GeoTIFFs. Notwithstanding ERDAS IMAGINE’s careful implementation of TIFF and GeoTIFF support, there are several things to be aware when creating the most portable GeoTIFF data possible. If we follow a few simple rules, we can provide data with a high level of portability, even to those beyond the geospatial community.

First, determine what level is the lowest level of support needed. I typically assume non-geospatial people will try to use the data in Microsoft Windows Picture and Fax Viewer or will insert the image into Microsoft Word. Hey, I know that is a bad idea, but a whole lot of people do it by accident, or because that is the best they have. Now, let’s not call them idiots because my mom has done this by accidently double-clicking on the TIFF. (Sorry mom.)

So, what TIFF parameters will create an image which will be supported the ‘lowest common software?’

1. GeoTIFF tags do not decrease portability. Software not using these GeoTIFF will ignore the tags. Because GeoTIFF followed TIFF6 specifications, true GeoTIFF’s will not cause a problem.

2. Unless you intend to open a lot of TIFF images at the same time, do not use tiling. If you need to open a lot of images at the same time, use tiling. While tiling is a standard TIFF option, and improves display speed in many software (especially for large images and lots of images), it decreases the portability of data. This is not a problem within ERDAS IMAGINE. It will handle a few dozen either striped or tiled images rapidly. But again, many lower-end software packages cannot handle TIFF data using tiling option, so use stripped TIFF (BIL) when in doubt.

3. Use the Red, Green, Blue (RGB, denoting 3 colors in the TIFF) option rather than Multispectral option. Multispectral is a standard TIFF option allowing for placement of more than three bands into a single TIFF. Many software products cannot support more than 3 colors per TIFF, and thus will not allow the display of the data.

In the modern geospatial industry, 4+ band data delivery is becoming more prevalent. Many providers are required to deliver data as a red, green, blue image and a NIR, red, green image for each frame. This means the deliverable has duplicated 2 bands, green and red. Sadly, until the key software vendors decide to support Multispectral TIFF, this will continue to be a problem for TIFF and thus GeoTIFF.

4. You typically want to keep compression to None or Packbits. Packbits is the TIFF implementation of run-length compression (RLE). I have never run access a product which does not support Packbits. I have in the past run access software which did not support JPEG and LZW inside a TIFF wrapper, but these are becoming less and less frequent.

My lowest common test software for TIFF data is Microsoft Windows Picture and Fax Viewer. It supports: Striping, RGB, No Compression; or Striping, RGB, Packbits Compression; or Striping, RGB, LZW Compression. If these tools can read TIFF, everything can (Microsoft is kind of cheap.)

5. While BigTIFF (aka TIFF-64) is the standard for TIFF data >4GB in file size, it is not widely adopted yet. Consider delivering a compressed image until it is more widely adopted. ECW and MrSID are excellent solutions within the geospatial community. In the future JPEG 2000 may become a good format for portability in and out of the geospatial community.

So, how do I know I have a true GeoTIFF? A true GeoTIFF will have all horizontal map coordinate, projection information contained within the TIFF tags. It even supports vertical projection information. For a test, move any ancillary files (non-TIFF files) to another folder and display the TIFF in ERDAS IMAGINE 9.1 SP4 or higher version (9.2 SP1 is the current version). Use the TIFF and GeoTIFF tag viewer within the Image Info capability to examine the projection information. If you see your projection defined correctly, then the GeoTIFF is a true GeoTIFF.

No comments: