Tiff and tfw

Source: Internet
Author: User

Abstract: A tfw file contains the space parameter (spatial reference) data of the relevant TIFF file.
This document describes in detail the parameters defined in the tfw file.

Overview
The two files are in tfw format.
ASCII header file
Image files
The image file is in TIFF Format (not compressed ).
Details
The tfw file name is the same as the corresponding TIFF file name, and is placed in the same directory as the source file. For example:
Image. tif
Image. tfw
The tfw file structure is simple. It is an ASCII text file containing six lines of content. You can use any ASCII text editor to open the tfw file. The content in the tfw file is as follows.

+ 6.00
-0.00
-0.00
-6.00
1709053.00
8107714.00


The following table describes each line in the tfw file.

Line description
1. The X resolution scale of a pixel in the map unit in the X direction.// The Explanation of the six parameters is clear: added by zhangjun
2 Translation volume.
3. Rotation quantity. (Angle)
4. negative value of the Y Resolution scale of a pixel in a map unit in the Y direction.
X coordinate of 5 pixels, 1 (top left.
Y coordinate of 6 pixels, 1 (top left.

Details:
The tfw file is a text file about the coordinate information of TIFF images. ArcInfo, microstation, and AutoCAD all support coordinate information files in this format. This file defines the affine relationship between pixel coordinates and actual geographic coordinates of an image. The basic principle is as follows:

X' = AX + by + c
Y' = dx + ey + F

Where:

X' = geographic X coordinates of pixels

Y' = geographic y coordinate of the pixel

X = pixel coordinates [column number]

Y = pixel coordinate [row number]

Pixel resolution in the = x direction

D, B = translation and rotation Coefficient

E = pixel resolution in the Y direction

C = pixel center X coordinate in the upper left corner of the raster Map

F = Y coordinate of the pixel center in the upper left corner of the raster Map

Instance:

I. tif format image, the image resolution is 980*784 * 24b, the coordinates of the pixel center in the upper left corner are [1000, 800], the geographic distance in the X direction is m, and the geographic distance in the Y direction is M, the coordinate information file is as follows:

1.02040816326531 A [pixel resolution in the X direction]

0.0 d [translation coefficient]

0.0 B [rotation coefficient]

-1.02040816326531 E [pixel resolution in the Y direction] (total negative value ?)

428000 C [pixel center X coordinate in the upper left corner of the raster map]

2556800 f [Y coordinate of the pixel center in the upper left corner of the raster map]

Resolution calculation:
1000/980 = 1.02040816326531
800/784 = 1.02040816326531

Note:
If it is a. JPG file, the extension of the coordinate information file is. jgw.

Refer:

// Added by zhangjun at 2011-2-12

 1Wld -- ESRI World File 2A World File File Is A Plain ASCII Text File Consisting Of Six Values Separated By Newlines. The Format Is:  3 Pixel X Size 4 Rotation About The Y Axis (Usually 0.0)  5 Rotation About The X Axis (Usually 0.0)// Who is right? Speak with facts  6 Negative Pixel Y Size 7 X Coordinate Of Upper Left Pixel Center  8 Y Coordinate Of Upper Left Pixel Center  9For Example:  1060.0000000000  110.0000000000 120.0000000000  13-60.0000000000  14440750.0000000000  153751290.0000000000  16You Can Construct That File Simply By Using Your Favorite Text Editor. 17World File Usually Has Suffix .Wld, But Sometimes It May Has .Tfw, Tifw, .Jgw Or Other Suffixes  
 

 
______________________________________________________________________________________
JPG map space data file-jgw file format // 2011-06-23 added by zhangjun at knowledge of fact Verification

The following are multiple formats of the jgw file, which can be discussed together:
The first format:
1. X-scale (the size of a pixel)
2. Rotating items
3. Rotating items
4. Negative y-scale (size of one pixel)
5. Conversion items, that is, the X coordinate in the upper left corner
6. Conversion items, that is, Y coordinates in the upper left corner

Second format:
1. x resolution scale of a pixel in a map unit in the X direction
2. Translation volume
3. Rotation volume
4. negative value of the Y Resolution scale of a pixel in the map unit in the Y direction
5. x coordinate of 1 (top left) pixel
6. Y coordinate of pixel (top left)

Third format (en ):
1. pixel x size
2. rotation about the Y axis (usually 0.0)
3. rotation about of the X axis (usually 0.0)
4. Negative pixel y size
5. x coordinate of upper left pixel center
6. Y coordinate of upper left pixel center

Fourth format:
1. How many meters does each grid point be deleted in the row direction?
2. x Rotation Angle
3. Y-direction Rotation Angle
4. How many meters does one grid point be deleted in the column direction?
5. x coordinate at the top left
6. Y coordinate at the top left


The first and third types are basically the same. The first type is a bit simple!

Example of a jgw file:
0.05410594
0.0000 d
0.0000 B
-0.05410594 E
25.023009 C
102.766439 F

A = x-scale (the size of a pixel)
E = negative Y-scale (size of one pixel)
B, d = rotation item
C, F = Conversion item, that is, the X coordinate and Y coordinate in the upper left corner
Generally, four points are used for Image Correction. If the image is not reversed, the rotation item is 0.

Note: The coordinate system used in this example is WGS84.

Computing of A, B, C, and F has many opinions on the network. A little messy!

Here is a brief description of the calculation method I use:
1. Determine the coordinates of the two corners of the image:
Determine the coordinates in the lower left corner and the upper right corner of the image map file.
I did not include specific data here. I used variables to illustrate the problem.
Coordinates in the lower left corner: (x1, Y1)
Coordinates in the upper right corner: (X2, Y2)
Number of pixel lines in the image map: Col
Number of pixel columns in the image map: Row

2. Determine the coordinates in the upper left corner of the image file:
Coordinates in the upper left corner: (x1, Y2)

3. Determine the rotation items:
Generally, 0.000000 is used as the rotation item.

4. Calculate the pixel size between the X and Y directions:
Pixel size in the X direction: (x2-x1)/COL
Pixel size in Y direction: (y2-y1)/row * (-1)

5. The data in the final jgw file is:
X2-x1/COL
0.000000
0.000000
(Y2-y1)/row * (-1)
X1
Y2

Note: I am based on the WGS84 coordinate system!


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.