newb - calc'ing geotiff world file internals

Ed McNierney ed at TOPOZONE.COM
Sun May 8 21:32:41 EDT 2005


Mike -

The values in a world file are in the units of the map projection.  Not
all maps use the UTM projection, so the units are not always UTM units.

The source map appears to be a standard scan of the printed map which
uses (see lower right corner) a "Polyconic Projection" in the NAD27
datum.  You need to find out the details of that polyconic projection in
order to understand the units.

If you don't know the mathematical parameters of the map projection,
you're not going to get very far (at least not accurately).  Someone on
the list may know the parameters used for this FS map - it's probably
pretty straightforward.

You can relax things a bit if you're simply trying to display the data.
If you don't really care about coordinates, AND if you don't intend to
integrate other data sets with this one, you can just make things up.
You can put pixel coordinates in the world file.  The last two lines are
the X and Y coordinates of the upper-left pixel.  If you make your units
pixels, with the usual Y-value decreasing as you go down, then the world
file for the top-left image would be:

1.0
0.0
0.0
-1.0
0.0
0.0

Meaning each pixel is 1x1 "units" and the top left is at (0,0).  If the
upper-left tile is 673 pixels wide and 795 pixels high, then the next
tile to the right would have the world file:

1.0
0.0
0.0
-1.0
673.0
0.0

That is, exactly the same but with the X starting point 673 units to the
right.  The tile below it would be:

1.0
0.0
0.0
-1.0
0.0
-795.0

Because you're moving down in the Y coordinate to negative numbers.

This sort of world file will work fine for displaying those tiles.  If
you need real geographic coordinates, you'll need to figure out the map
projection.

By the way, since these are JPEG images, the standard world file
extension is JGW, not TFW.  I would highly recommend that you convert
your images to TIFF and use TFW files; JPEG is a very poor choice for
geospatial data, and your performance will suffer.  TIFF is much better
for this purpose.

        - Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
Phone: +1 (978) 251-4242
Fax: +1 (978) 251-1396
ed at topozone.com

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Mike Dee
Sent: Sunday, May 08, 2005 8:03 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] newb - calc'ing geotiff world file
internals

All,

First time dipping my toe in the GIS world after many years of wanting
to get into it.  Finally have a project that I can leverage with
mapserver and I'm immediately in over my head on trying to figure out
what goes into the TFW file.

I'm attempting to create a raster tile index with the images within
http://www.fs.fed.us/r5/stanislaus/maps/emigrant/ -- I've made a similar
layout of the larger images at
http://www.snfv.org/forum/schedule/em_map_big.html that I'm actually
going to be using the images from, the first link shows how the images
are already laid out in a tile like setting.

I've spent a couple of days digging around thru google trying to figure
out what the values inside the TFW file would equate to but I'm stumped.
How would I figure out what the pixel width is for X & Y?  are the last
2 coords in UTM?  I've read the HOWTO at
http://mapserver.gis.umn.edu/doc44/raster-howto.html but it doesn't go
into much detail, seems like it assumes that you know the values prior
to writing the TFW file.  I've also read thru the geotiff spec at
http://www.remotesensing.org/geotiff/spec/contents.html too but it
didn't help me either.

The project I'm starting would create a layer(s) on this map that would
show issues in the wilderness area such as wet trails, heavy mosquitos,
trails under repair, etc.

Thanks in advance

Mike



More information about the mapserver-users mailing list