Georeferencing tiff by creating tfw file

Gambin Dejan Dejan.Gambin at PULA.HR
Wed Nov 16 08:59:29 EST 2005


Hi,

Even there are probably some utils I can use, I would still like to know
how can I calculate the "pixel size" parameter in tfw file (so the first
and fourth parameter) from the existing tiff file and the following
informations:

For example, "gdalinfo my.tif" says

Driver: GTiff/GeoTIFF
Size is 8857, 5905
Coordinate System is `'
Origin = (5455749.998925,5021000.001075)
Pixel Size = (0.00215084,-0.00215084)
Metadata:
  TIFFTAG_XRESOLUTION=300
  TIFFTAG_YRESOLUTION=300
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
Corner Coordinates:
Upper Left  ( 5455749.999, 5021000.001)
Lower Left  ( 5455749.999, 5020987.300)
Upper Right ( 5455769.049, 5021000.001)
Lower Right ( 5455769.049, 5020987.300)
Center      ( 5455759.524, 5020993.651)
Band 1 Block=8857x5905 Type=Byte, ColorInterp=Palette
  Color Table (RGB with 2 entries)
    0: 255,255,255,255
    1: 0,0,0,255

I have xy coordinates (in meters): 5455750 and 5021000 and the scale of
25.40363554. I have tried using the simple formula like:

pixel size in inches = scale/resolution, so 25.40363554/300 and
converting it to meters gives me 0.002150841. But this is not correct,
right?

Wiht CAD overlay I have got 0.08467878514170, that is probably right...

What am I doing wrong? Is it the resolution that I am using? Do I have
to use screen resolution or what?

thanks 

regards, dejan



More information about the mapserver-users mailing list