As an alternative to using distortImage, if the background imagery is projected with an unrotated Mercator projection and you know the projection latitude
of the imagery, you can use the chart2omg program. This is most useful for TIFF files of nautical charts, which we often
use as a backdrop in imagery. The command must be repeated for all three bands of the data. The projection latitude is
specified with -plat, this value is usually explicitly written somewhere on the chart.
The same file type for coordinates can be used as explained in the distortImage example in the mapsheets 1 manual.
# Convert the tif file to a ppm file
convert tif:777801.tif ppm:777801.ppm
# Convert the PPM file into OMG format, with a file for every band
# this creates 777801.band1, 777801.band2, 777801.band3
PCItoJHC -in 777801.ppm -out 777801 -ppm
# Get rid of the .ppm files, it's no longer needed...
# Having read off the projection latitude from the chart (68.5 degrees), and having created a .coords file containing
# the long,lat,x,y pixels of two coordinates (which do not have the same longitude), we can fill the header portion
# of the mapsheets with the correct lat/long bounds, pixel size and projection latitude.
# Contents of .coords file are:
# -112 68 671.5 8984.5
# -109.5 68.5 7492.5 5307.5
# Note that non-integer pixel values are allowed, this is NOT the case with distortImage
# The effect of the three following commands is to fill in the header information such that the mapsheets
# are now fully georeferenced. This assumes a WGS84 ellipsoid, use edhead to change if this is not the case.
chart2omg -in 777801.band1 -plat 68.5 -coords 777801.coords
chart2omg -in 777801.band2 -plat 68.5 -coords 777801.coords
chart2omg -in 777801.band3 -plat 68.5 -coords 777801.coords
Last modified March 24th, 2005 by J. Beaudoin