ArcGIS Desktop 10.2 - How to create a tfw file?

5550
9
Jump to solution
03-11-2015 07:46 AM
VincentLaunstorfer
Occasional Contributor III

Hi,

I have a SRTM30 tile named E140S10.gif attached, containing 600 column and 750 rows. The upper left corner is 140° W, thus +140 and 10°S, thus -10, according to the filename...

In a text editor, I tried to create a georeferenced file .gfw (attached):

0.066666666
0.000000
0.000000
-0.066666666
140
-10

I calculated the 0.06666666 by dividing 40° (width of the tile) / 600 pixels = 0.0666666666

and 50° (height of the tile) / 750 pixels = 0.0666666666

The gfw seems correct and has the same name as the .gif file, located in the same directory, but do not open in ArcMap. I get an error "missing spatial reference...".

I don't understand why?

0 Kudos
1 Solution

Accepted Solutions
DarrenWiens2
MVP Honored Contributor

The world file does not contain any information about the intended spatial reference system. You still need to Define Projection (presumably WGS 1984), in addition to using the world file. It works just fine for me, with your original world file.

1.PNG

Because the data itself now has a spatial reference, you can reproject it however you want:

1.PNG

View solution in original post

0 Kudos
9 Replies
IanMurray
Frequent Contributor

Are you trying to just bring in the world file, because you can't just bring in a world file into ArcGIS.  Try removing the .gif from your map, and then bringing it back in again now that you have a world file for your image.  ArcGIS should recognize that the .gif has a .gfw with it in the same directory include the spatial reference information.  Kinda how when you bring in a shapefile, you only see the .shp in catalog but it knows to bring the .shx, .sbx, .dbf, etc. as well for the complete file.  If you try to bring in one of the other components from say windows explorer, it doesn't count as a valid file type.

0 Kudos
MahtabAlam1
Occasional Contributor

You probably need to add spatial reference information in aux files. Please refer Auxiliary files

0 Kudos
VinceAngelo
Esri Esteemed Contributor

FWIW: The convention for representing 1/15th in decimal is to include a final 7 ("0.0666666666666667"), which will result in less coordinate drift over larger images.  Best practice is to carry out repeating decimals 15-16 places, rounding up on the final digit if necessary.

0 Kudos
VincentLaunstorfer
Occasional Contributor III

I just fixed the decimals in the .gfw file but still do not work!

0.066666666666667
0.000000
0.000000
-0.066666666666667
140
-10

Were you able to make a proper .gfw file with the attachments I uploaded?

Cheers

0 Kudos
IanMurray
Frequent Contributor

I could make one just fine.  Are you trying to add this to an existing map, or to a new map?

0 Kudos
VincentLaunstorfer
Occasional Contributor III

I tried to open the .gif raster in a blank ArcMap session and I still get the "missing spatial information message..."!

Ian, would you be able to upload the .gfw you made and I could try it.

Cheers

0 Kudos
IanMurray
Frequent Contributor

It technically still is missing some spatial information, it does not have have a spatial reference, so it can't be projected, but it can work in a geographic coordinate system.  I made a new map document and selected a Geographic Coordinate System (WGS 1984) and it came in just fine.  I have a screenshot comparing it to a world boundaries shapefile with thats in WGS 1984 and they line up fine.  gif_Screenshot.png

Note: I used the values Vince posted for the worldfile.

0 Kudos
DarrenWiens2
MVP Honored Contributor

The world file does not contain any information about the intended spatial reference system. You still need to Define Projection (presumably WGS 1984), in addition to using the world file. It works just fine for me, with your original world file.

1.PNG

Because the data itself now has a spatial reference, you can reproject it however you want:

1.PNG

0 Kudos
VincentLaunstorfer
Occasional Contributor III

Hi,

To finish this discussion, the world file .gfw is correct but the spatial reference is unknown in the .gfw. When opening the .gif image in ArcMap, you still get the "missing spatial reference..." warning (see attach), but it will place itself assuming the image is WGS84, and then reprojecting properly.

In order to explicitly indicate the spatial reference, or GCS, you need to right-click and edit the Spatial Reference of the raster and indicate it is WGS84, as shown attach.

And it solves the problem completely.

0 Kudos