Archive for September, 2009

Georeferencing DPI Quirks

Sunday, September 20th, 2009

TIFF files have horizontal and vertical DPI numbers set in the header. You can use a program like IrfanView to see and set the values.  Turns out the DPI settings have an impact on how ArcView handles coordinates for geo-referencing.  So here’s a little reference.

  • TFW world files do not seem to use the DPI values, and use straight pixels.
  • AUX.XML files, produced by the newer versions of ArcView, do use the DPI values. The list of X and Y points created during geo-referencing are the pixel location divided by the DPI value.
  • TFWX files, produced in association with AUX.XML, are just plain old world files. So if you happen to correctly resample (change pixel dimensions and DPI, such that the “inches” are still the same) a file that has an AUX.XML and a TFWX, it will display just fine in ArcView. However, a program that can’t read the AUX.XML and relies on the TFWX instead, will not put the image in the right location.

Beware that when you convert images from one format to another, you might lose the DPI setting.  JPEG and ECW files, for instance, may not have any DPI set at all. So when converted to TIFF, ArcView sees no values and uses straight pixels.  If you then open that TIFF file in Corel PhotoPaint (or perhaps Photoshop), the DPI is set to a default, like 72 dpi, and saved with the file. Suddenly the points don’t work any more, and if you reload from the saved text file of points, it still won’t work.

One last hint: you can use Excel to open the points (.txt) file and change the X and Y values in the first two columns.  If you go from a file with no DPI values to 72 dpi, divide each value (only the first two columns) by 72.  Probably can do this in the AUX.XML file too, but you’ll have to write some XSL or do it by hand.