Unrotating mapsheets with zero rotation angle

This is particularly handy when you want to make ESRI grid files, but accidentally made rotated mapsheets (with a rotation angle of zero). In this scenario, the mapsheet Area3.r4 is rotated, but a rotation angle of zero. We need to create the equivalent mapsheet with an unrotated header.

Run make_blank to create a new blank mapsheet from the old one, make sure you choose the SAME pixel resolution!!! This command creates a blank mapsheet with an unrotated header (I usually name it temp.blank). Make sure you choose the SAME data type and pixel resolution!!!

	make_blank -force_orthogonal -area Area3.r4
This replaces the header of your old mapsheet with the new unrotated one that we created in the last step. I like to copy the original mapsheet to a temporary file and replace the header of that instead of mucking around with th e original file.
	cp Area3.r4 temp.r4
	edhead -replacehead temp.blank temp.r4
Now that we've got our unrotated mapsheet, we can go ahead and make an ESRI gridfile. This generates a .hdr and .flt file.
	r4toESRI -in temp.r4 -out Area3
I usually make a gzip'd tarball when sending it off to someone:
	tar -cvf Area3.tar Area3.hdr Area3.flt
	gzip Area3.tar
Don't forget to clean up...
	rm Area3.hdr Area3.flt
	rm temp.r4 temp.blank

Muchos gracias to Steve Brucker for busting through the above for me...
Last modified by J. Beaudoin, October 5th, 2005